Last active
November 16, 2016 11:54
-
-
Save bhrott/30c76859e2193a680024ad9b66987b3e to your computer and use it in GitHub Desktop.
React Native : Android : Open Settings Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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