Eclipse for Android displays application icons for each class when deployed

I am working on an Android application using Eclipse and just started to notice a strange glitch.

When I deploy an application on my phone for some reason, several application icons appear in my Applications folder. Each icon leads me to a different class page in my application when clicked. Has anyone else experienced this as well?

Here is a screenshot of the problem when starting the application from the emulator on my laptop.

Weird bug

Since the problem occurs in the emulator, I know that the reason for this is not my phone.

Each of the icons that you see in this screenshot represents a different activity in my manifest file.

Here's how the action is created in my manifest.

<activity android:name=".MainJava"> <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.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".AppClass"> <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.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 


Will you say that this error is caused by the way I set up the activity? If so, how do you suggest me edit the steps to fix this problem?

I have never seen this in any of the applications that I created before.

+4
source share
2 answers

Only MainActivity(Launcher Activity) have intent filter with action as Main and category as Launcher ,

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

And delete this two lines for other actions.

+6
source

Edit:

 <activity android:name=".MainJava"> <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.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".AppClass"> <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.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 

To:

 <activity android:name=".MainJava"> <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.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".AppClass"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 

There must be only one MAIN and one LAUNCHER

+2
source

All Articles