开发者

ProgressDialog disappers after screen lock

I have a ProgressDialog that is running and accepting the percent complete from a thread handl开发者_如何学运维e. When the screen is locked, then unlocked, the app returns back to the home screen of the app and does not continue to display the ProgressDialog.

How can I return to the same page with the ProgressDialog on it? I assume I need to somehow save the handle resource and recreate it on onResume but am unsure how to do this.

Thanks.


It seems you're on the right track. Assuming you have class variables showProgressDialog and myProgress:

@Override
protected void onResume() {
    super.onResume();
    if(showProgressDialog)
      {
        myProgressDialog.show();
        myProgressDialog.setProgress(myProgress);
      }

}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜