It can take tens of seconds during this time the user is left with the black screen. Some users think that the application has failed. I would like to display a "standby" message.
I have tried toast I have tried setContentView (R.layout.main) with a message in the layout, neither does it give expected results while the screen remains black during the loading process.
That's because the UI thread is running this heavy thing, which blocks contact with the user Will do You have to do this heavy load in a second thread. I recommend Asynctask:
- onPreExecute (): Show standby message.
- doInBackground (parameter ...): weigh heavily.
- OnPostExceute (result r): You have been done with heavy loads, so go ahead and remove the standby message.
Comments
Post a Comment