简体   繁体   中英

Android App crashes when disabling the location permission from settings?

I am working on Xamarin Android Application. I have asked a location permission from my app which if I enable from the app works properly. But when i put the app in background and go to settings and disable the location permission and start the app again, the app crashes. What could be the possible solution to this problem?

From Android M Android Required some permission at Run time like Location permission. when you disable that permission from settings then when app running on background it not found that permission to access GPS in background.That's why app crash. to avoid app crash show some message when permission declined and Handle Exception using try catch block.

Read more about android Run time permission from here

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