Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse to Android show app icons for each class when deployed

I'm working on an Android app using Eclipse and just started noticing a weird glitch.

When I deploy the app to my phone for some reason multiple app icons appear in my "Apps" folder area. Each icon brings me to a different class page within my app when tapped. Has anyone else experienced this as well?

Here's a screenshot of the issue when running the app from the emulator on my laptop.

Weird bug

Since the issue is appearing in the emulator I know that it isn't my phone that's causing the error.

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

Here's how the activity is set up 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>


Would you say that this error being caused because of the way that I am setting up the activities? If so, how would you suggest that I edit the activities to fix this problem?

I've never seen this in any of the apps I've built before this one.

like image 693
localhost Avatar asked Feb 19 '23 21:02

localhost


1 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 Remove this Two line For other Activity.

like image 140
Samir Mangroliya Avatar answered Apr 26 '23 19:04

Samir Mangroliya