mn6vdv23g
mn6vdv23g

Reputation: 734

Every Activity of my application is shown as an app on its own

Just like the title says, for some reason which I dont understand, Every Activity I create in my application is shown as an icon for an application on the phone's app menu.

Could someone please help me solve this wierd problem?

If you need some code just ask for it (I dont know which code is related with these kind of stuff).

Thanks!

Upvotes: 1

Views: 97

Answers (2)

jnthnjns
jnthnjns

Reputation: 8925

In your manifest remove these lines from all Activities except the one you want to open on:

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

Example:

<activity
    android:name="your.package.name.MainActivity"
    android:label="@string/app_name" >
    <intent-filter>
        <!-- This line declares this Activity as the start point -->
        <action android:name="android.intent.action.MAIN" />
        <!-- This line adds a launcher icon -->
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity
    android:name="your.package.name.OtherActivity"
    android:label="@string/app_name" >
</activity>

Upvotes: 6

Akhil
Akhil

Reputation: 6697

In your manifest file you must have set launcher intent-filter for all of your activities.. Keep launcher intent-filter only in launcher activity..

Upvotes: 0

Related Questions