Mike
Mike

Reputation: 791

Multiple Application Icons Are Installed On Phone When Running Androids App

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?

Upvotes: 2

Views: 2510

Answers (3)

Ravi
Ravi

Reputation: 2367

You should use the code given below with your start up activity only so you can remove it from others activity than only the one icon will came-

  <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

Upvotes: 0

SegFault
SegFault

Reputation: 954

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"

Upvotes: 1

Blumer
Blumer

Reputation: 5035

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.

Upvotes: 7

Related Questions