doc removeUpdates (ListListener listener):
LocationListener.
LocationListener, STOP GPS
statusbar.so GPS,
: ( Android 2.3):
try{
String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if(!provider.contains("gps")){
final Intent poke = new Intent();
poke.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
}
catch(Exception e)
{
Log.d("Location", " exception thrown in enabling GPS "+e);
}
Manifest.xml:
android.permission.WRITE_SECURE_SETTINGS
: Gps. :
startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS), 1);