Skip to content

Instantly share code, notes, and snippets.

@namchuai
Created May 8, 2020 04:55
Show Gist options
  • Save namchuai/ebd57b323a4d9201a270e4a3a18fed02 to your computer and use it in GitHub Desktop.
Save namchuai/ebd57b323a4d9201a270e4a3a18fed02 to your computer and use it in GitHub Desktop.
Android: Showing System popup from service
AlertDialog alertDialog = new AlertDialog.Builder(this)
.setTitle("Title")
.setMessage("Are you sure?")
.create();
alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
alertDialog.show();
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment