Doc says https://developer.android.com/reference/android/content/Intent.html#ACTION_MAIN is an entry point.
Example code:
<activity android:name="org.A.A"
android:theme="@style/NoTitle"
android:screenOrientation="behind"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="org.A.C"
android:theme="@style/NoTitle"
android:launchMode="singleTop"
android:screenOrientation="behind">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="org.A.B"
android:theme="@style/NoTitle"
android:launchMode="singleTop"
android:screenOrientation="behind">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
1) So using android.intent.action.ACTION_MAIN acts as an entry point to the parent component (parent component I mean the activity or receiver or service)?
2) If yes, Entry point from where, as there is no CATEGORY mentioned.
Android apps are composed of different components. e.g.
Activity
,Service
,BroadcastReceiver
, andContentProvider
and each component can act as an entry point of the app.Let's take activity as an example, you have defined an activity in your application with following action
and I start an activity in my app with following intent.
Now what will happen? System will search for activities with
com.yourapp.SOME_ACTION
action and if it finds one (in current scenario, it will be activity you have created withcom.yourapp.SOME_ACTION
in your app), it will start your app (if it is not already started) and will open the activity in your app.See, now I can enter into your app by using
Activity
withcom.yourapp.SOME_ACTION
. Same thing happens in case of other components.