-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App became Background when request permission. #12
Comments
hm, but that's a system modal dialog not an app dialog, so to be fair your app is not in the foreground right now ... |
Do you have a solution to this problem? Because the user still thinks it is on the foreground |
The reason for this problem is that: When request permissions, the activity will call onPause, don't not call onStop(Because the activity is still visiable.). But you can't listen system callbacks. The solution is, only use onStop (not onPause) to handle the logic. |
@TakWolf I know this library is not perfect, but I'm also not convinced there's a logical confusion. I think that as far as the system is concerned the app is in the background - both in the permissions case and the phone call case - because the foreground UI in both cases is not a UI controlled by the app, and the app has been told to pause. The purpose of this library is to tell you when the system thinks the app is in the background, so it seems to me that it is behaving correctly. That said, I am quite sympathetic to Sammy's case where a permission request is being handled, and actually in that case there is something you can do about it: @chihung93 You could use the fact that you know when a call to
|
@steveliles : thank you for your help . |
@TakWolf : I found a lib to avoid this issue .You should try it , maybe it suits your situation. |
@chihung93 Thanks for the offer, I will try to use it. |
When I request permission, App became Background.
The text was updated successfully, but these errors were encountered: