0

in my first activity I have two intent filters. The first one is for regular access from the launcher. The second one is used when a user tries to unzip a file.

        android:name=".MyApplication">

<activity
            android:name=".SplashActivity"
            android:label="@string/app_name" 
             android:icon="@drawable/ico"

             android:theme="@style/Theme.Sherlock.NoActionBar"
            >
            <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"/>
                <category android:name="android.intent.category.ALTERNATIVE"/>
                <data android:mimeType="application/zip"/>
            </intent-filter>


        </activity>

The problem is that in the launcher I get two icons instead of one . How can I get only one icon and mantain the ability to run the activity with the second intent filter. I have tried removing (or changing to a different category)

<category android:name="android.intent.category.ALTERNATIVE"/>

Thanks

EDIT: The problems seems somehow related with Android Studio (v 0.1.6 and 0.1.7) as with Eclipse only one icon shows up.

Gyonder
  • 3,674
  • 7
  • 32
  • 49
  • Look at this answer: http://stackoverflow.com/questions/11703143/how-can-i-start-main-activity-with-the-help-of-intent-filter , and try android.intent.category.DEFAULT – Volodymyr Jun 26 '13 at 13:27
  • Thanks #Vladimir S but that answer is not about having one icon with two intent filters – Gyonder Jun 26 '13 at 13:32
  • I know, but I thought that the problem could be solved adding android.intent.category.DEFAULT instead android.intent.category.ALTERNATIVE, by the way, check your minifest, maybe you have another activity with category: android.intent.category.LAUNCHER – Volodymyr Jun 26 '13 at 13:38

0 Answers0