0

I wanted my app to ask for location permission each time the app was run.

It seems the device remembers that the permission has been granted earlier and won't ask for them on subsequent executions of the app.

Is there any way to reset/uninstall the app so I can see if my newer ask permission code works?

Thanks.

Rahul Singh Chandrabhan
  • 2,531
  • 5
  • 22
  • 33

2 Answers2

1

If it's for debugging purposes, you can find your app in Settings -> Applications -> YourApp -> Storage -> Clear Data. That will remove everything you store in your app space including preferences and permissions. That way you can Run your code and have a fresh start. In older Android Versions you can find teh same screen by long pressing the app icon and selecting App info. If you want the same thing to happen at runtime with your users, you can manually clear the data each time your app is closed by using the following code:

((ActivityManager)context.getSystemService(ACTIVITY_SERVICE)).clearApplicationUserData();

(This requires a min sdk of 19). If your min target is older than 19, there areother way to do it as well. Check this answer.

Nikos Hidalgo
  • 3,666
  • 9
  • 25
  • 39
0

If you want just check newer ask permission code is working or not

Just go to Settings > Apps > Your App > App Info > Permissions > Location

Disable that permission and You will see run-time permission dialog again once relaunch App!!

Kishore Jethava
  • 6,666
  • 5
  • 35
  • 51