Open abhinashpati opened 7 years ago
Thanks for reporting. I'll investigate on it.
I have the same problem.
I am not able to replicate it, I've just run the example in the repo and it is working on a Nougat device. Could you please check if the example is working for you?
It look like the problem is about the solution that you use in this library. The library add the view to window manager directly so it doesn't minimized when user minimized the app. That's different with Snackbar library from Android Design Support Library because they use layout in each activity to add the Snackbar's view (Snackbar at findSuitableParent(View view)).
I think this can make the problem occur in some device firmware. As I tested with example in the repo, it work fine on Samsung Galaxy S8 and Moto Z but won't work with Android One
I have investigated a little on this topic and it seems some devices have to ask for this permission: SYSTEM_ALERT_WINDOW, but it can only be achieved through the Settings, I've used this intent for the task: new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + packageName)); but some devices do not respond to the intent.
Hey there. Did you manage to fix this bug? I really like this project, but can't use it from android 7 above. Can you fix it?
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
Hi loregr
Could you please solve this problem? I need this library to work with my APP.
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? same problem brother please resolve it ... as of now any solution there...
Well, it's 2020 and this same problem continues... No fix to this?
this bug no fix yet?
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:679) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93) at greco.lorenzo.com.lgsnackbar.core.LGSnackbarPresenter.show(LGSnackbarPresenter.java:51) at greco.lorenzo.com.lgsnackbar.core.LGSnackbar.show(LGSnackbar.java:90) at greco.lorenzo.com.lgsnackbar.LGSnackbarManager.showSnackbar(LGSnackbarManager.java:91) at greco.lorenzo.com.lgsnackbar.LGSnackbarManager.show(LGSnackbarManager.java:86) at greco.lorenzo.com.lgsnackbar.LGSnackbarManager.show(LGSnackbarManager.java:70)
I'm only getting this on Android 7 or above devices. Below 7, it's working fine.