gdx-dialogs
gdx-dialogs copied to clipboard
Exception android.view.WindowManager$BadTokenException: Unable to add window -- token
Some of my Users get this Exceptions randomly:
Exception android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@1b77d4b9 is not valid; is your activity running? android.view.ViewRootImpl.setView (ViewRootImpl.java:574) android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:282) android.view.WindowManagerImpl.addView (WindowManagerImpl.java:85) android.app.Dialog.show (Dialog.java:298) de.tomgrill.gdxdialogs.android.dialogs.AndroidGDXButtonDialog$1.run (AndroidGDXButtonDialog.java:70) android.os.Handler.handleCallback (Handler.java:739) android.os.Handler.dispatchMessage (Handler.java:95) android.os.Looper.loop (Looper.java:135) android.app.ActivityThread.main (ActivityThread.java:5910) java.lang.reflect.Method.invoke (Method.java) java.lang.reflect.Method.invoke (Method.java:372) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1405)
May or may not be related to: http://dimitar.me/android-displaying-dialogs-from-background-threads/
Can you give some information how I could reproduce this. Do you use Threads on your project?
Thats the problem :/
I can't because it happened on a user of my app. I have 5.000+ Users but it only appeared 4 times so I think its difficult to reproduce.
I just want to say that there is a possibility that something doesn't work correctly and can trigger other problems
In this case I will leave it open for now. When I am in the mute I will try to reproduce with the link above. Maybe I can figure something out.
I have a question how would you call a Dialog in a LibGDX AsyncTask?
Looking through the code, I'm sure this API allows calling from any thread. The setup of the dialog is in the end, queued to run on the UI Thread.
The Problem still exists
Will probably exist for a very long time, till I stumble accidentally over the same problem. Or I can analyse a working example which reproduces this issue.
the problem still exists. please refer this for solution. ToastCompat
thanks, will look into it. may take a while.