0

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

Binil Surendran
  • 2,524
  • 6
  • 35
  • 58

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
  • 29,432
  • 22
  • 140
  • 255