Shweta Shweta - 1 year ago 376
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download