Questions tagged [android-popupwindow]

The popupWindow is an AndroidView Container displayed on top of the current activity to show any view.

JavaDoc: http://developer.android.com/reference/android/widget/PopupWindow.html

362 questions
92
votes
12 answers

Blur or dim background when Android PopupWindow active

I would like to be able to either blur or dim the background when I show my popup window using popup.showAtLocation, and unblur/dim the background when popup.dismiss is called. I have tried applying layout params FLAG_BLUR_BEHIND and FLAG_DIM_BEHIND…
k_day
  • 1,379
  • 2
  • 14
  • 19
76
votes
8 answers

How to create a popup window (PopupWindow) in Android

To create a simple working PopupWindow, we need to do the following: popup_example.xml:
jennifer
  • 8,133
  • 22
  • 69
  • 96
55
votes
5 answers

how to make animation for popup window in android

I hava a popup window in my application, its appears when some button clicked I want to set fade in animation to this window, I put the xml file in "res/anim" folder and set the animation style for the popup window but the animation does not…
Ishaq
  • 561
  • 1
  • 4
  • 6
51
votes
3 answers

Is there a simple example of the PopupWindow class using Android v2.0?

I looked online and was not able to find a working example of the PopupWindow class. The code examples I found online either compile but do not work, or are using methods which have since been removed (such as Activity.getViewInflate()). Is there a…
Todd
  • 1,906
  • 2
  • 16
  • 21
39
votes
3 answers

Android PopupWindow elevation does not show shadow

Android PopupWindow does not show shadows when the elevation is set. It appears to support it from the documentation. I am using 5.0 Lollipop. Creating the popup as follows: popupWindow = new PopupWindow(context); …
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141
24
votes
3 answers

How to achieve custom dialog at the bottom of the screen in Android

Which component do I choose to achieve custom dialog at the bottom as shown in the below image? Shall I choose alertdialog,popupwindow, or fragmentdialog?
23
votes
2 answers

TextInputLayout: RuntimeException - Failed to resolve attribute at index 24

I keep on getting this error when I try to setErrorEnabled on my textInputLayout : 03-12 12:29:03.206 5706-5706/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp, PID: 5706 …
Simon
  • 19,658
  • 27
  • 149
  • 217
23
votes
1 answer

Pop up window to display some stuff in a fragment

I am trying to make something like a pop-up window, that would appear when clicked on a view in a fragment. I want this pop-up window or whatever, to not make the fragment dark, like a Dialog Fragment does. And I also want the pop up to be…
Sartheris Stormhammer
  • 2,534
  • 8
  • 37
  • 81
19
votes
3 answers

How to open Draw Overlay permission popup in MIUI?

I want to open this permission popup in MIUI. I have tried this code, but this will not open permission manager popup for a particular app. public static Intent toPermissionManager(Context context, String packageName) { Intent intent = new…
Sagar
  • 585
  • 1
  • 9
  • 28
19
votes
2 answers

Should I use a PopupWindow or DialogFragment for accepting input?

I am doing a Popup with 3 Spinners and an EditText. After reading many blogs and articles I can't decide which is the best option, PopupWindow or DialogFragment. The criteria would be: Compatibility with different Android's versions Performance If…
Daniel
  • 1,189
  • 2
  • 12
  • 30
17
votes
2 answers

How to correctly show a popup menu below a TextView, similar to Spinner?

Background I had to create a spinner-like view, which has this behavior: textView that has the selected item text in it, with an arrow icon on the right that indicates whether it's in "open" state. upon clicking the view, a popup menu appears below…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
16
votes
6 answers

PopupWindow - not working on a few devices

I use following code to show a small popup: public static PopupWindow showImportMenu(Activity activity, View anchor, PopupWindowClickListener onClickListener) { LayoutInflater inflater = LayoutInflater.from(activity); PopupImportBinding…
prom85
  • 16,896
  • 17
  • 122
  • 242
16
votes
2 answers

Android popup window not filling screen size?

I am trying to make a simple pop up window. But every time I make one, it ends up being super small...and not the length I want it to be. This is how the pop up looks: Here is my layout for the pop up:
TheQ
  • 1,949
  • 10
  • 38
  • 63
14
votes
4 answers

PopupWindow getting clipped on custom keyboard for Android API 28

I made a custom keyboard. When you long press a key, a PopupWindow shows some extra choices above the key. The problem is that in API 28, this popup gets clipped (or even completely hidden for the top row). I had solved this problem for API < 28…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
13
votes
11 answers

Change background popupMenu in Android

I tried to change background of popupmenu, but my implementation does not work. This is my code:
1
2 3
24 25