0

I understand that to resolve implicit intents we need intent-filters with action and category_default.

  1. But my question is what if an activity declared with intent filter with action, but no category. 1a) What does this intent filter does and what's its purpose?
  2. And what if there are several such activities?

        <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>
    
sofs1
  • 3,834
  • 11
  • 51
  • 89

1 Answers1

0

But my question is what if an activity declared with intent filter with action, but no category.

That activity will be ignored, as it does not specify a category, and therefore will not match any Intent for which there is a category. All Intent objects used by startActivity() are added to the DEFAULT category if they do not specify some other category.

And what if there are several such activities?

Then you have several activities that will be ignored.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491