Created
May 8, 2020 04:55
-
-
Save namchuai/ebd57b323a4d9201a270e4a3a18fed02 to your computer and use it in GitHub Desktop.
Android: Showing System popup from service
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
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