Skip to content

Instantly share code, notes, and snippets.

@nickfox
Created Jan 31, 2011
Embed
What would you like to do?
// 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