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
精彩评论