I would like to block the system pop up dialog box from a service, the one which appears when we long press the power button. I using below code to block it from an activity
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}
But I want to do it in a service since I want to block it even if the app is closed.
0 comments:
Post a Comment