Androidmanifest Registering for an event
<activity android:name= ". Backgrounddemo "> <intent-filter> <action android:name=" Android.intent.action.MAIN "/> <category android:name= "Android.intent.category.LAUNCHER"/> </intent-filter> </ Activity>
Intent-filter in <action android:name= "Android.intent.action.MAIN"/> and <category android:name= "Android: Intent.category.LAUNCHER "/>
Indicates that Backgrounddemo is the main activity of the project, which is the first thing to start the Android program.
Backgrounddemo Program Entry
public class Backgrounddemo extends Activity { @Override protected void onCreate (Bundle Savedinstancestate) { Super. OnCreate (savedinstancestate); Setcontentview (R.layout.image_main); }}
Backgrounddemo inherits from activity. Activity is an active base class provided by the Android system, and all activities in the project must inherit it in order to have an active feature.
The OnCreate () method invokes the Setcontentview () method, which introduces a image_main.xml this layout file for the current activity.
In fact, the Android programming logic and view separation, it is not recommended to write the interface directly in the activity, but in the layout file to write the interface, and then introduced in the activity.
Original address: http://www.cnblogs.com/woider/p/5114666.html
Blank Android program basics, manifest and activity brief