Search code examples
androidxmleclipseandroid-layoutoverlapping

Overlapping layout


I'm working on an android project with 1 main activity layout that displays one button. I have a second layout with an image and nothing else on it. I want the second layout to overlap, on top of the first layout when the button is pressed. I've figured out how to handle the click event for the button, but I'm not sure how I would make the second layout overlap on top of the first one. Any ideas?

I'm trying to produce something similar to this picture enter image description here


Solution

  • As mentioned by Gabe, you can use a popup window if both the layout are bound to the same activity.

    If you intend to have different activity for different layout, you can make the activity to be shown as popup to be in dialog theme as follows,

    <activity android:theme="@android:style/Theme.Dialog" />