Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The approach differs a bit if you have multiple Activities within your app, but if you are only talking about a single Activity then the Activity itself won't show anything until the onResume() is called. Prior to that, the only thing that will be displayed is the background image of the Application/Activity. Setting a background image for your Activity can greatly increase the perceived startup speed, since they will display immediately. Romain Guy discusses background images a bit here: <a href="http://www.curious-creature.org/2009/03/04/speed-up-your-android-ui/" rel="nofollow">http://www.curious-creature.org/2009/03/04/speed-up-your-android-ui/</a>.</p> <p>If your app has a lot of startup crunching to do then you should do that work on a separate thread and let the onCreate(), onStart(), onResume() proceed quickly. Those methods should try to do as little as possible so the Activity appears to the user as soon as possible. If you want a loading or splash screen to be visible while it loads there different approaches. For the sake of starting simple, let's say you just want to have a loading screen with no animation, just an image. One way to do this would be to set the Activities background image to the loading screen image via XML. In the onCreate() start a thread with your loading processes, so it doesn't have to wait for it to finish in order to continue starting the Activity. In the XML layout, set the root ViewGroup for your layout to have a visibility of gone. This way your views won't appear and it will just show the background loading image. It will also allow these views to be inflated and setup.</p> <p>Then, when the processes are finished, set the visibility of the ViewGroup to visible to have it appear to the user and if you want, you can change the background image too.</p> <p>If you don't want to go the splash screen route, still make sure no long running methods are happening in the start up methods, get those onto another thread. You can show your Activity right away and just put up a loading animation if need be.</p> <p>Obviously there are a ton of approaches and it all depends on what you really need. Hope that helps in someway.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload