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
4
votes
2 answers

Android: Popup menu position

This is a simple and silly question but I am developing an application in which i am showing a popup menu on click of a button. The code is as follows: PopupMenu popup = new PopupMenu(mContext,…
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
4
votes
0 answers

"android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@41d51058 is not valid;"

I have a EditText inside a PopupWindow, that is displayed correctly, when touched the SoftInput keyboard is open, if a misspelled word is wrote in the field, it will have red underline on it, if it is touched the following Exception occurs. 06-12…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
4
votes
1 answer

Changing font color of items in xml string-array

I am trying to display a spinner inside a pop up window. And I want a portion of the text of each drop down item to be green. More specifically, an option would look like : "Transaction Type: Pay Cash, Meet Up". And I want the words "Transaction…
Nikhil
  • 155
  • 2
  • 12
3
votes
0 answers

How to dismiss PopupWindow by swipe to top while using ZoomageView inside it?

I'm using the ZoomageView library in PopupWindows to show an image with zoomable capacity. But the problem is that I want to dismiss it by a swipe to the top but can't because ZoomageView has its own ScaleGestureDetector. I added my own custom…
Gk Mohammad Emon
  • 6,084
  • 3
  • 42
  • 42
3
votes
0 answers

Android PopupWindow TooManySurfacesException

My game windows are all floating PopupWindows backpackPopupWindow = new PopupWindow(backpackView, width, height, focusable); Some of my users reported after 30 minutes or so it will randomly crash with no information in my game's log file. I was…
KisnardOnline
  • 653
  • 4
  • 16
  • 42
3
votes
3 answers

PopupWindow being cutoff towards bottom of screen

PopupWindow inflates fine until it is near bottom of screen it's being cut off. Anyone know how I can it inflate upwards when it's towards bottom of screen? public SelectBucketMenu(Context context) { super(context); this.mContext =…
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
3
votes
3 answers

Dismissing PopupWindow the way PopupMenu can be dismissed by clicking outside

I develop an Android App for tablets. When the user clicks on a setting button I want to show the user a dialog on the upper right side of the screen where the settings can be configured. Given that the dialog is complex I feel like PopupWindow is…
Christian
  • 25,249
  • 40
  • 134
  • 225
3
votes
2 answers

Bad token exception on spinner which uses (android:entries="@array/type") in fragment

When I run my code on some devices (Like MI note 4) it gives me an exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@7989790 is not valid; is your activity running? But when I run…
Vrushi Patel
  • 2,361
  • 1
  • 17
  • 30
3
votes
2 answers

PopupWindow goes out screen's bottom boundary

This is a simplified code for what I use to show a popup window when making a long click on a GridView item. When the item on the most right the popup window gets adjusted to be within the screen. But when the item near the bottom of the screen the…
Jack
  • 693
  • 1
  • 7
  • 25
3
votes
1 answer

Get absolute coordinates of view inside popup window

I have a draggable popup window fragment. I need to get the x and y coordinates of that fragment in onSaveInstanceState(). I got the width and height of the fragment by using getView().getWidth() and getView().getHeight(). But if i use…
3
votes
0 answers

popup window in custom keyboard

I work in a custom keyboard. I know about ppupkeyboard (and popup character) to create a popup characters in long press on a key. first watch this video https://www.mediafire.com/file/nbuotyewdcrmbht/20171007_161400.mp4 I want a popupwindow(or any…
3
votes
1 answer

ESP8266 Captive portal with pop-up

Has anyone ever succeeded in getting a captive portal to cause a pop-up for the redirected content to a specific landing page on an Arduino or ESP8266? I've tried everything under the sun and while my android will complain about a non-connected…
Scott
  • 7,983
  • 2
  • 26
  • 41
3
votes
1 answer

PopupWindow doesn't respond to drag and drop events

I have a menu icon in my application. When I drag and drop something on it, it will show a popup. I need to extend my drag and drop to this PopupWindow. I am doing this as below. Created a PopupWindow as shown View popupView =…
heyjii
  • 834
  • 8
  • 26
3
votes
3 answers

Android Nougat 7.1.1 showAtLocation(...) Gravity not working

This is related to this question: Android Nougat PopupWindow showAsDropDown(...) Gravity not working However, when I applied this fix: if (android.os.Build.VERSION.SDK_INT >=24) { int[] a = new int[2]; anchorView.getLocationInWindow(a); …
Kim Montano
  • 2,185
  • 4
  • 26
  • 39
3
votes
0 answers

PopupWindow inside Dialog

I have a problem with PopupWindow class used inside a Dialog. The code works fine and the popup does show, but it is clipped to the content area of the Dialog. In my case, the popup can contain quite a bit of text, which makes it look weird, being…
Kelevandos
  • 7,024
  • 2
  • 29
  • 46