I wish to create a activity that look like a popup window
That is with transparent background for activity als i wish to show it in custom position on scree that is on right corner of device screen
what i did was inside onCreate
of pop over like activty
Display display = getWindow().getWindowManager().getDefaultDisplay();
WindowManager.LayoutParams params = getWindow().getAttributes();
// params.x = -20;
params.height = (display.getHeight()) / 2;
params.width = (display.getWidth()) / 2;
// params.y = -10;
params.gravity = Gravity.RIGHT;
getWindow().setAttributes(params);
in maifest
<activity android:name=".DialogAct"
android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
This is what my launcher activity looks like
So when i click on search on action bar i'm sending intent to my new activity .I want to make it look like pop just below the search icon
This what i obtained is
You can see search of previous activity is clicked and new activity is loaded(blue portion). As you can see the new activity moves to centre of screen . but i want it just below the action bar icon.
i tried params.gravity = Gravity.TOP | Gravity.RIGHT;
. then i got this
I want to place it just below the action bar of previous activity . I tried many ways to achieve it but failed. so can anyone suggest a methode