0

I have already written some Android application, but recently I find that I still not really know how an Android Application works. My problems are something about the AndroidManifest.xml, I want to know something about the life cycle of Android applications. In the AndroidManifest.xml, there is an Application label and there is a sub-label of activity. In the activity label, main activity of the application will be marked like this:

<activity android:theme="@*android:style/Theme.NoTitleBar" android:label="@string/app_name" android:name="com.sofesec.mainactivity" android:launchMode="singleTask" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

This means that the class called "com.sofesec.mainactivity" is the main activity of the application, and it will get executed first. But there is a field called "android: name" in the label of application -- the parent lable of activity -- and the value of the field may be "com.sofesec.lcz.test". When the application starts, the "com.softsec.lcz.test" class will be executed as well. I don't know which class is executed first. This is something about life cycle of an android application. Thanks for giving me some help !

This is the code of my application here:

public class test extends Application {
    private final String TAG = "test";
    @Override
    public void onCreate() {
        super.onCreate();
        OriginalApplication oa = new OriginalApplication(this);
        oa.configApplicationEnv();
    }
}
Ri Syoutaku
  • 45
  • 1
  • 7

1 Answers1

0

Use below link to know in detail about activity life cycle and manifest file.

Android activity life cycle - what are all these methods for?

http://developer.android.com/guide/topics/manifest/manifest-intro.html

Community
  • 1
  • 1
Robi Kumar Tomar
  • 3,392
  • 3
  • 17
  • 26
  • I know the life cycle of activity, but I don't know the life cycle of application. For example, in the application, the function onCreate() can also be Overrided and the function will be executed. I don't know the two onCreate function, in application and in activity. Thanks! – Ri Syoutaku Aug 06 '13 at 07:39
  • I thinks you have not seen the post given by Yaqub Ahmad which described how the life cycle works in application,he has used the log to see it in details. – Robi Kumar Tomar Aug 06 '13 at 08:05
  • I think the example show the life cycle of the activity, instead of the application. – Ri Syoutaku Aug 06 '13 at 08:12