-2

I'm new in android and I'm trying to use alertdialog but it always covers the actionbar.

How can I do something like dropdown menu as shown in the picture ?

Ienter image description here

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
askingPPl
  • 263
  • 3
  • 20

1 Answers1

0

try this

WindowManager.LayoutParams wmlp = dialog.getWindow().getAttributes();

wmlp.gravity = Gravity.TOP | Gravity.LEFT;
 wmlp.x = 100;   //x position
 wmlp.y = 100;   //y position

 dialog.show();

source https://stackoverflow.com/a/6050911/1320616

Community
  • 1
  • 1
Ankit Aggarwal
  • 5,317
  • 2
  • 30
  • 53