Skip to content

Instantly share code, notes, and snippets.

@bhrott
Last active November 16, 2016 11:54
Show Gist options
  • Save bhrott/30c76859e2193a680024ad9b66987b3e to your computer and use it in GitHub Desktop.
Save bhrott/30c76859e2193a680024ad9b66987b3e to your computer and use it in GitHub Desktop.
React Native : Android : Open Settings Page
@ReactMethod
public void openSettingsPage() {
final Intent i = new Intent();
i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.setData(Uri.parse("package:" + getReactApplicationContext().getPackageName()));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
getReactApplicationContext().startActivity(i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment