Alert Dialog showing again after Screen On

374 views Asked by At

i have an other problem. I have an Alert Dialog shown on onCreate. The problem is that if i turn screen off and back on the dialog will appear again, so i have two dialog with the same content after screen unlock. How can i fix this to not show the dialog is allready showing?

Thanks!

1

There are 1 answers

0
Iosif On

FAST FIX:

// your class starts here
int x=0;
// your onCreate starts here
if(x==0){ 
  alert.show();
  x=1;
}

Alert Dialog Dismiss Code

alert.dismiss();
x=0;

And it will work