Open irsalshabirin opened 8 years ago
Same here...
i got it on a XiaoMi MI MAX running 6.0.1 Can't tell where and how exactly it happened. The stack trace I got is exactly as above.
Xiaomi Mi4i, Android 5.0.2, MIUI 8 - the same error
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@142544eb -- permission denied for this window type at android.view.ViewRootImpl.setView(ViewRootImpl.java:714) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:282) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at com.github.johnpersano.supertoasts.library.Toaster.displaySuperToast(Toaster.java:186) at com.github.johnpersano.supertoasts.library.Toaster.handleMessage(Toaster.java:136) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5546) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:163)
True. MI devices plagued with this issue after a recent update.
It appears as though 6.0 now requires permission android.permission.SYSTEM_ALERT_WINDOW
to add a view to the WindowManager
. I'll investigate this further. I'm not sure what will happen to the SuperToast
class then, I can't expect developers to add that permission for a simple toast message.
Something new on this?
Could reproduce this error on Xiami Redmi 3 with Miui 8 but none of my other Android 5 / 6 devices.
Got the same issue with 1.3.4.1 with Xiaomi devices Redmi Note 3 (hennessy) running Android 5.0 and Mi 4c (libra) running Android 5.1.
Here is the stack:
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@2ffb4010 -- permission denied for this window type at android.view.ViewRootImpl.setView(ViewRootImpl.java:714) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:282) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at com.github.johnpersano.supertoasts.ManagerSuperToast.displaySuperToast(ManagerSuperToast.java:189) at com.github.johnpersano.supertoasts.ManagerSuperToast.handleMessage(ManagerSuperToast.java:146) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5546) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Got the same issue also. Devices affected are:
OnePlus A3000 Xiaomi Redmi Note 3 Xiaomi Redmi Note 2 Xiaomi HM NOTE 1LTE
Any update on this?
running into this too on several different xiaomi devices!
evil question, but is the way supertoasts work different from the default android toasts? why does it need the overlay flag?
is there something in the code that can be made an option, so that it doesn't need the flag?
Hello guys, I just want to inform, that one of my user just wrote me, that this issue seems to be solved in new version MIUI 8.1 (currently in 'dev' state). So let's wait on final version of MIUI rom.
Hey guys, I also get the question in my xiaomi phone, this maybe helps you. https://www.liaohuqiu.net/cn/posts/android-windows-manager/
Same weird issue...
As this issue happens only with Xiaomi devices, I've created a temporary quick fix to avoid crashes:
private void showSafely(SuperToast superToast){
if (!android.os.Build.MANUFACTURER.toLowerCase().contains("xiaomi")){
superToast.show();
}
}
in some device i've got an error like this :
please help me, thankss