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
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论