Skip to content

Instantly share code, notes, and snippets.

@nickfox
Created February 7, 2011 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickfox/814231 to your computer and use it in GitHub Desktop.
Save nickfox/814231 to your computer and use it in GitHub Desktop.
// launches the settings screen that lets user turn on gps radio
private void launchGPSOptions() {
final ComponentName toLaunch = new ComponentName("com.android.settings","com.android.settings.SecuritySettings");
final Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(toLaunch);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(intent, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment