0

The answer to the question here provides the method to activate the location if it has been turned off.

Now, Android has three location settings currently:

  1. High Accuracy: Uses GPS, WiFi and cellular network to get the location.
  2. Battery Saving: Uses cellular networks and WiFi to determine the location.
  3. Device only: Uses GPS to determine the users location.

Checking the location status using the line:

gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);

I redirect the user to the Activity where he can switch on the location. Now if the user turns on the location in the battery saving mode, will I get the location.

Also, for the redirection I do:

context.startActivity(myIntent)

Is there anyway to call startActivityForResult() here to verify if the user has turned on the location and depending on that redirect the user to different activities?

Community
  • 1
  • 1
praxmon
  • 5,009
  • 22
  • 74
  • 121
  • If you are getting location using gps you won't find location if gps is off. But you can use fuse location to get current using other providers also. Check [this](http://stackoverflow.com/a/30029307/3022836) – Kunu May 26 '15 at 07:10

1 Answers1

0

In Battery Saving mode GPS is OFF, so through GPS you will not get the location. but in Battery saving mode you can use WIFI and Mobile networks to determine the location

Sushil
  • 147
  • 1
  • 9