开发者

How can I refresh my screen or run initial process in background

开发者 https://www.devze.com 2023-02-10 14:53 出处:网络
My main screen has a process which can take 20-30 seconds to load the information on to the screen. While this is happening the screen is just black. I have tried using a ProgressDialog to let the use

My main screen has a process which can take 20-30 seconds to load the information on to the screen. While this is happening the screen is just black. I have tried using a ProgressDialog to let the user know the process is running but as the screen is bl开发者_运维百科ack you cannot see it. Can I refresh the screen so that the dialog is visible or do I need to run my initial process in background so that the screen is visible?


Anything that takes over ~200ms should be run as a background task. You can either use an AsyncTask or a Thread/Handler combination.

  • AsyncTask
  • Painless threading
  • Threading
  • Designing for responsiveness
  • Thread documentation
  • Handler documentation
0

精彩评论

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