0

Possible Duplicate:
Android Activity Life Cycle - difference between onPause() and OnStop()

What happend when the application launcher icon was clicked?

How the Android system instantiates the main activity and objects it refers to? What is the methods call hierarchy?

Thanks

Community
  • 1
  • 1
Aaron
  • 1
  • 1
  • Thanks for your warmful answers and sorry for the confusion. What I want to know is what has done by the system to instantiate the main activity? For example, Activity class extends ContextThemeWrapper, and in turn ContextWrapper, and Context, my question is how the system instantiateds a implementation of Context class and how to instantiate by the Context object? – Aaron Mar 11 '11 at 09:01

3 Answers3

0

System starts activity by intent with action "android.intent.action.MAIN" and category "android.intent.category.LAUNCHER". Activity startup process does not differ from any other activity startup.

Alexander Oleynikov
  • 19,190
  • 11
  • 37
  • 51
0

You need to read Activity Life cycle and AndroidMenifest for the same.

Sandy
  • 6,285
  • 15
  • 65
  • 93
0

Take a look at the part of the manifest:

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".TestApp"
              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>

For each activity you define intent filters. The activity which has LAUNCHER category and MAIN action is started when you click on an application icon.

When you create new project in Eclipse these filters are added by default to your first created Activity.

Marcin Gil
  • 68,043
  • 8
  • 59
  • 60