Android Instance Illustration Tutorial Directory
http://blog.csdn.net/wyx100/article/details/45061407
I. Course functions
This course tells you to create a new interface and interface switch (from interface to interface).
Two. Course interface
Interface One (Start interface)
Interface two (main interface)
Three. Work flow
2 procedures are required to complete a page switchover:
1. Establish a project, see section Ii.
http://blog.csdn.net/wyx100/article/details/45248209
Development can be continued on the basis of the project.
2. Setting up the Boot interface
First introduce the resource picture
Creating an XML file for the boot interface layout
Edit the Start.xml file to introduce the layout
Edit the Start.xml file and introduce the picture view (the view that holds the picture, Images Vies)
Introducing Pictures
Interface One (Start interface)
Start.xml File Source code
<?xml version= "1.0" encoding= "UTF-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android " android:layout_width=" fill_parent " android:layout_height=" fill_parent " android:o rientation= "vertical" > <imageview android:id= "@+id/imageview1" android:layout_width= "Fill_ Parent " android:layout_height=" fill_parent " android:src=" @drawable/bg "/></linearlayout>
3. Writing the Java class for the boot interface
Startactivity.java
Three seconds after the boot screen, jump to the main interface, the page jumps by intent completed.
Package Com.example.helloword;import Android.app.activity;import Android.content.intent;import android.os.Bundle; Import Android.os.handler;import Android.widget.imageview;public class StartActivity extends Activity {/** called when The activity is first created. */private final int splash_display_lenght = 3000; Delay three seconds @Overridepublic void OnCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Setcontentview (R.layout.start); New Handler (). postdelayed (New Runnable () { @Override public void Run () { Intent mainintent = new Intent ( Startactivity.this,mainactivity.class); StartActivity.this.startActivity (mainintent); StartActivity.this.finish (); } }, Splash_display_lenght); }}
Interface switching
Main code
new Handler (). postdelayed (New Runnable () { @Override public void Run () {& nbsp; Intent mainintent = new Intent ( Startactivity.this,mainactivity.class); Interface Jump Definition StartActivity.this.startActivity (mainintent); Start interface Jump StartActivity.this.finish (); After the interface jump is complete, remove interface one } }, Splash_display_lenght); The interface shows the length of
4. Modify the Boot profile (Androidmanifest.xml) to start from the Start screen, enter the Start screen, will automatically execute the Java code of the Boot interface, complete the interface switch.
Androidmanifest.xml
<?xml version= "1.0" encoding= "Utf-8"? ><manifest xmlns:android= "http://schemas.android.com/apk/res/ Android "package=" Com.example.helloword "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk android:minsdkversion= "8" android:targetsdkversion= "/> <application android:allowbackup=" True "android:icon=" @drawable/ic_launcher "android:label=" @string/app_name "android:theme=" @style/app Theme "> <activity android:name=" com.example.helloword.StartActivity "android:label=" @s Tring/app_name "> <intent-filter> <action android:name=" Android.intent.action.MAIN " /> <category android:name= "Android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name= ". Mainactivity "/> </application></manifest>
5. Complete the project and start running. How to run, see section Two, the first Android project.
Develop a new Android interface, interface jump See graphic android---Android Development example tutorial three or four