tags:

views:

54

answers:

2

My app has 2 activities - A and B. From homescreen I launch A, from A I launch B. The activity stack looks like this: A-B. Now I press HOME button, and from homescreen click again on my app icon, which launches A and adds it on top of the activity stack, which now looks like this: A-B-A. But I just want to bring my application to foreground, is that possible in Android?

P.S. My other app works as I want, what can be the problem?

A: 

make sure you configure your intent-filter like this:

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
Soulreaper
I have exactly this intent filter.
fhucho
A: 

You need to set the android:launchMode of your Activity in your Manifest.xml.

See here: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

mbaird
Agreed, this gives you an option for SingleInstance and SingleTask. SingleTask looks like it will only allow one instance of an Activity.
TreeUK