views:

52

answers:

2

I don't quite understand what the IntentFilter does? Here is an example manifest:

<activity android:name="SomeActivity" android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

What does the <action> and <category> tags do? Say if I declare:

<activity android:name="AnotherActivity" android:label="AnotherActivity">
    <intent-filter>
        <action android:name="android.intent.action.PICK" />
        <action android:name="android.intent.action.VIEW" />
        <action android:name="android.intent.action.INSERT" />
    </intent-filter>
</activity>

Does that even do anything if used in conjunction with an Intent object? Please help me understand an IntentFilter?

A: 

See the documentation here and here.

QRohlf
+1  A: 
PM - Paresh Mayani