开发者

What is the best approach to make the dialog boxes persistent on the screens when application comes to foreground?

开发者 https://www.devze.com 2023-02-15 16:58 出处:网络
I want to know the best approach to handle the dialog boxes to be appeared when the user application comes to foreground.

I want to know the best approach to handle the dialog boxes to be appeared when the user application comes to foreground.

My scenario would be like if am displaying some message in the progress dialog or normal alert dialog and i press the home button to take the application to background. And when i come back to the screen the progress dialog or alert dialog should be persisitent on the screen.

I tried putting this block in onStart() but it shows me NULL pointer exception.

onStart(){
if alertdialo开发者_运维技巧g.isShowing() alertdialog.show();
}


if(alertdialog == null){
  // create your dialog here and then show it
} else if (!alertdialog.isShowing()) {
  alertdialog.show();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消