I'm working on an application that lists a stored library using a ListActivity.
My question is, is when I open application it has a visible loading time before the XML view is inflated. During this time only the application name is shown. This is noticeable on quite a few application out there but others seem to have implemented loading screens and what not.
Does anyone have a solution to this or know how to make a good loading screen?
Cheers!
If your activity is taking more than a couple of tenths of a second to start up, you are doing too much work in onCreate()
, onStart()
, or onResume()
. Move that work to a background thread, perhaps using AsyncTask
.
Then, if you want to do something while the background thread is crunching away, you can use a ProgressDialog
, or call setContentView()
multiple times (initially with a splash screen, then later with the full UI once the background work is done), or whatever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With