Search code examples
androidandroid-permissionsandroid-5.1.1-lollipoptarget-sdk

Permission issue on android lollipop device after upgarde


I have updated my device few days ago. Its an lollipop upgrade, but still it started asking permissions for my app at run time.

I have targetSDK 21

But when I open app it pops up for gps permission and if user denied it, it stops working. I also used checkSelfPermission but it is retuning Granted(0) every time even user denied it. My current android version of Phone is android 5.1.1

Device having android 5.1.1 but its OS is customised by MI like samsung phones. So after upgrade it started asking permission for resource like GPS, Contact and other. Its android sdk version is android 5.1.1 not Android 6.0 which have Runtime Permissions.


Solution

  • You require to implement runtime permission check for Android-21 plus device. Check the solution over here. You will find how array has been utilized in that, mostly that is were user stucks.

    Additionally, if denied then you cannot force user to use that functionality. In short you need to bypass that module.