简体   繁体   中英

Android Revoke Permissions when App is running - Can I recover the App

I have just moved my target SDK to v9.

I have hit the issue where when I have my app running, I open the settings and revoke one of the permissions. When I then bring my app to the foreground it restarts and tries to restore the app, however it fails to restore properly.

My understanding is the behaviour should be the same as rotating the device. However in this case my app can recover correctly.

What the behaviour is when revoking permission when the app is running? Should the app just terminate and start from the beginning, or is it possible to recover?

My understanding the behaviour should be the same as rotating the device.

No.

Can someone tell me what the behaviour is when revoking a permission when the app is running.

Your app's processes are terminated. Android will start a fresh process for your app when the user returns to it. Android may attempt to restart the last activity the user was in, depending on the timing of all of these events.

In general, the behavior is the same as if the user left your app for a while (say, 20 minutes), Android terminated the process in the background, and then the user returned to it.

Should the app just terminate and the just start from the beginning, or is it possible to recover.

We cannot answer that, as the details will depend on the app. Ideally, your app can "recover", but it will require you to design the app to be able to deal with a fresh process from every activity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM