I was trying to set the intent filters for a simple app to handle urls. I applied the basic tags for "intent-filter" like "action" ,"category".
Here I used 2 "intent-filter" tags.
<activity
        android:name=".MyBrowserActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter >
           <action android:name="android.intent.action.VIEW" />
           <data android:scheme="http" />
           <category android:name="android.intent.category.BROWSABLE"/>
           <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</activity>
But the Launcher icon is not shown after instaling if I apply intent filters as shown below in just 1 "intent-filter" tag.
<activity
        android:name=".MyBrowserActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="http" />
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</activity>
The main question here I wanted to ask is "Why the app launcher icon disappears in the second case when there is just 1 "intent-filter".
You need to split the intent filter up into two. So you have
<INTENT FILTER>
Action category 
</INTENT FILTER>
<INTENT FILTER>
Action category data
</INTENT FILTER>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With