tags:

views:

57

answers:

2

I am developing an android app w/ Eclipse. Whenever I run the app on my phone or the emulator, four application icons are installed on the device. I am guessing it is related to my manifest file which has three activities (3 are for tabs).

When I uninstall the app, all of the icons are removed from the phone. Upon a reinstall, all four show back up.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.seebergers.navyprtcalculator"
      android:versionCode="1"
      android:versionName="1.0">
    <application 
        android:icon="@drawable/app_icon" 
        android:label="@string/app_name" 
        android:debuggable="true">
        <activity android:name=".NavyPRTCalculator" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       <activity android:name=".BcaActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".PrtActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".BcaTapeActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest> 

Thoughts?

+2  A: 

You're on the right track. Remove ...

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

from all but one of your activities. That tag tells the activity that it belongs in the Launcher.

Blumer
And actually for that matter, I'm gonna guess you don't need the intent filter at all for anything except the main one you want to display on launch.
Blumer
+1  A: 

You are setting all the four activities as the main and launcher category type. So all the four activities will be treated as separate entities and launched simultaneously. Use launcher category only for the activity which needs to be shown after launch.

Just remove category android:name="android.intent.category.LAUNCHER"

SegFault
Awesome. I have not found a great tutorial on the manifest file, so I was expecting that was my issue. Will have to look at http://developer.android.com/guide/topics/manifest/manifest-intro.html some more.
Mike