Today, we found the procedure entrance, and I've got two name, and I've written a test program, roughly as follows:
See Mainfest.xml first.
<application
Android:allowbackup= "true"
android:icon= "@drawable/ic_launcher"
Android:name= "Com.example.test1.app"
Android:label= "@string/app_name"
Android:theme= "@style/apptheme" >
<activity
Android:name= "Com.example.test1.MainActivity"
Android:label= "@string/app_name" >
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
K See app
Package com.example.test1;
Import android.app.Application;
Import Android.os.Bundle;
Import Android.util.Log;
public class App extends application{
public void OnCreate () {
Super.oncreate ();
LOG.D ("TT", "Application");
}
}
See activity as follows
public class Mainactivity extends Activity {
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
LOG.D ("TT", "activity");
New app ();
}
}
Finally, we look at the log file is clear:
10-28 15:40:54.915:d/tt (4116): Application
10-28 15:40:55.525:d/tt (4116): Activity
This means that application's name corresponds to the class that was created when the program was installed .
Then I opened the second time as follows:
There is only one message
Android.app.Application
Base class for those who need to maintain global application state. You can provide your own implementation by specifying it name in your androidmanifest.xml ' s <application> tag, whic H would cause that class to being instantiated for if the process for your application/package is created.
Base class for those who need to maintain global application state. You can provide your own implementation by specifying it name in your androidmanifest.xml ' s <application> tag, whic H would cause that class to being instantiated for if the process for your application/package is created.
Do you first execute the class for the name of the application or the class for name in the activity?