tags:

views:

52

answers:

1

I have a single Android application that houses a suite of applications. I want each application to install with its own launcher icon, so I have a few activities with the same intent filter.

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

It works just fine if I close out of an application using the back button. Each launcher icon starts a different activity. However, if I simply send the application into the background using the home button and then try to start a different activity, the one I put into the background is brought to the foreground instead of the correct activity starting.

Can I make the multiple icons work or do I need to create a central activity as a way to start all the sub-applications?

+2  A: 

You'll have to set the activities with different task affinities. See the Application Fundamentals section from the Android docs.

Yoni Samlan
That did it. Just a note though since it wasn't clear from the documentation, the taskAffinity attribute must be a string with at least one '.' I just used the package names for mine since each sub-application is in its own package.
Mr. Ambiguous