Skip to content

Instantly share code, notes, and snippets.

@vtthach
Last active March 9, 2018 15:22
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 vtthach/da0ceaa6c0448680d82b4fef1fadc333 to your computer and use it in GitHub Desktop.
Save vtthach/da0ceaa6c0448680d82b4fef1fadc333 to your computer and use it in GitHub Desktop.
Draw over other app - SYSTEM_ALERT_WINDOW
Every app that requests the SYSTEM_ALERT_WINDOW permission and that is installed through the Play Store
(version 6.0.5 or higher is required), will have granted the permission automatically.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
// Show alert dialog to the user saying a separate permission is needed
// Launch the settings activity if the user prefers
Intent myIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
startActivity(myIntent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment