Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse loads separate activities instead of application

I'm using Eclipse and android SDK (with ADT Plugin), I don't know if it's some kind of configuration issue or it's some code problem. Whenever I load an app that I made from scratch (this means not using another existing code or one sample from the library) to my device or run it on the emulator, the entire app will load as "separate" apps, which are the activities. For example, if the app is named "Hello world" and it has two activities, "MainActivity" and "SecondaryActivity", both of them will show up on the device with their names as app names and sharing the app icon on the menu. Now, if I go to settings, "Hello World" appears as an application, now behaving again like it should. This doesn't affect the operation of the app, however, it's annoying to have more than 1 icon launching the same app. The problem is that, when i first used eclipse, this was not happening.

Just in case it helps, I've already re-installed the entire android SDK and the ADT plugin, as well, I tried using 3 different Eclipse versions (classic, EE, and Java developers), none of them seem to work, even though, in the Graphical Layout for any activity, the name of the app is showed in the bar with the app's icon, but running on the emulator or a real device it shows the activity's name there instead. I've looked everywhere and I haven't solved the problem. Thanks!

like image 535
MalancheK Avatar asked Jul 30 '12 06:07

MalancheK


2 Answers

Check your manifest to see if more than one activity has this:

<category android:name="android.intent.category.LAUNCHER" />
like image 76
Turnsole Avatar answered Oct 28 '22 16:10

Turnsole


The answer I found for the above problem is, replace category.LAUNCHER to category.EMBED in all the activities apart from the MainActivity in your manifest file.

like image 45
olasitha Avatar answered Oct 28 '22 16:10

olasitha