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?

fhucho
  • 34,062
  • 40
  • 136
  • 186

3 Answers3

0

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>
Moritz
  • 10,124
  • 7
  • 51
  • 61
0

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

Mark B
  • 183,023
  • 24
  • 297
  • 295
0

You are seeing this nasty Android bug. See my answer for how to get around it.

And yes, it still exists, even in Android 5 :-(

Community
  • 1
  • 1
David Wasser
  • 93,459
  • 16
  • 209
  • 274