Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Launcher Icon Disappears from screen

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".

like image 328
Atul Dhawan Avatar asked Feb 18 '14 05:02

Atul Dhawan


1 Answers

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>
like image 177
Orphamiel Avatar answered Sep 22 '22 11:09

Orphamiel