Shweta Shweta - 7 months ago 191
Android Question

How to dismiss system dialog in Android?

I have to dismiss this system

(Attached below).
I am getting this value but I am not able to dismiss it programmatically in Service not in Activity.

My question is:

  1. Is it possible to dismiss it ? if yes please help or guide me how to achieve it.

enter image description here


Please check it

public void onWindowFocusChanged(boolean hasFocus) {

        if (! hasFocus) {
            Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);

It is working in my code.