0

I want to dismiss the system generated run time user permission programmatically. Is there any way??

Binil Surendran
  • 2,374
  • 5
  • 32
  • 56

1 Answers1

0

Send an intent with action of Intent.ACTION_CLOSE_SYSTEM_DIALOGS.

This is sent by the system when the HOME key is pressed and should close all dialogs.


The below code is copied from a related question.

public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    if (! hasFocus) {
        Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        sendBroadcast(closeDialog);
    }
}
Richard Le Mesurier
  • 28,920
  • 20
  • 132
  • 247