I want to start location service in background in android. How to start location service without opening settings? I don't want alert dialog which will open settings.
Asked
Active
Viewed 806 times
0
-
You must need to "ON" location in order to start location service from settings in android device if its not "ON". – Nitesh Nov 17 '15 at 12:34
-
you mean open settings ->On location service – AmolRaj Nov 17 '15 at 12:38
-
but i don't want manually..only through code in android – AmolRaj Nov 17 '15 at 12:40
-
You can't do this. Location API must be explicitly enabled by user otherwise guys like you could create applications which continuously drain battery charge and also violate users' privacy;) – Lingviston Nov 17 '15 at 12:48
-
2Possible duplicate of [Android activate gps with AlertDialog: how to wait for the user to take action?](http://stackoverflow.com/questions/12044552/android-activate-gps-with-alertdialog-how-to-wait-for-the-user-to-take-action) – Narayan Acharya Nov 17 '15 at 12:59
1 Answers
0
Not possible unless you do it manually. Otherwise you can prompt the user to open Location settings page and turn on from there using any AlertDialog

Jas
- 3,207
- 2
- 15
- 45