This article describes the implementation of the Android splash screen. Share to everyone for your reference. The specific analysis is as follows:
When the splash screen is used frequently in the application, a background thread is started to prepare resources for running the master program.
Android to implement the splash screen can do this:
Here is the code for the Splash.xml layout file:
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android" android:layout_height = "Fill_parent" android:layout_width= "fill_parent" android:orientation= "vertical" ><imageview android: layout_height= "Fill_parent" android:layout_width= "fill_parent" android:scaletype= "FitCenter" android:src= "@ Drawable/splash "></ImageView></LinearLayout>
Put a ImageView load splash screen picture
Splashactivity starts as the main view:
/**Called when the activity is first created.*/@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.splash); Handler x=NewHandler (); X.postdelayed (NewSplashhandler (), 2000); } classSplashhandlerImplementsrunnable{ Public voidrun () {startactivity (NewIntent (Getapplication (), mainactivity.class)); Splashactivity. This. Finish (); } }
Hopefully this article will help you with Android programming.
My Android Best Practices--android boot Screen implementation method