Android AlertDialog: TYPE_SYSTEM_ALERT -
i have tried out know , can find, still cannot alert dialog show type_system_alert. shows on app when open it, not pop if app not on front.
i've got:
final alertdialog.builder d = new alertdialog.builder(this); d.settitle("app name"); d.setmessage("message"); d.setpositivebutton("ok", null); d.seticon(r.drawable.ic_launcher); alertdialog dialog = d.create(); dialog.getwindow().settype(windowmanager.layoutparams.type_system_alert); d.show();
and have in manifest:
<uses-permission android:name="android.permission.system_alert_window" />
what missing??
the function flow before alert following:
- broadcast receiver listens incoming sms messages.
- once received, passes message function in mainactivity using "runonuithread".
- the message parsed , alert dialog shown. why type_system_alert not working?? can see logcat message parsed ok still alert dialog not showing system alert. anyone?
the required permission system apps:
<permission android:name="android.permission.system_alert_window" android:protectionlevel= "signature|preinstalled|appop|pre23|development"/>