I also face the same problem, what I did was in manifest, inside activity, just included android:launchMode="singleTop" and its working fine.
What "singleTop" will do is, The "standard" and "singleTop" modes differ from each other in just one respect: Every time there's new intent for a "standard" activity, a new instance of the class is created to respond to that intent. Each instance handles a single intent. Similarly, a new instance of a "singleTop" activity may also be created to handle a new intent. However, if the target task already has an existing instance of the activity at the top of its stack, that instance will receive the new intent (in an onNewIntent() call); a new instance is not created. http://developer.android.com/guide/topics/manifest/activity-element.html#lmode Nithin On Apr 21, 9:05 am, Kenneth WON <[email protected]> wrote: > Hi, Dianne Hackborn, > > Thank you! > In the main activity, I will start a service, so I am calling > startService() in onCreate(). > Is that not necessary? > > On Apr 21, 11:25 am, Dianne Hackborn <[email protected]> wrote: > > > > > Make sure you aren't calling startActivity() anywhere, such as in > > onCreate(). > > > Look at the log (adb logcat) and event log (adb logcat -b events) to see > > what the system is saying about launching and handling activities. > > > Please don't use singleTask or singleInstance to fix such problems, they are > > not needed and have other repercussions you probably don't want. > > > On Tue, Apr 20, 2010 at 7:07 PM, Kenneth WON <[email protected]> wrote: > > > Hi, thank you for your help! > > > But I tried to add android:launchMode="singleTask" or > > > android:launchMode="singleInstance" in the <activity> before, but it > > > seems not work. > > > The app still running twice or more at the same time by rotate screen > > > or press return button, and launch the app. > > > > On Apr 21, 4:38 am, "~ TreKing" <[email protected]> wrote: > > > > On Tue, Apr 20, 2010 at 2:06 AM, Kenneth WON <[email protected]> > > > wrote: > > > > > But my expected result is just have one and only one app A launch. > > > > >http://developer.android.com/intl/fr/guide/topics/manifest/activity-e... > > > > <http://developer.android.com/intl/fr/guide/topics/manifest/activity-e.. > > > .> > > > > --------------------------------------------------------------------------- > > > ---------------------- > > > > TreKing - Chicago transit tracking app for Android-powered > > > > deviceshttp:// > > > sites.google.com/site/rezmobileapps/treking > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected]<android-developers%2Bunsubs > > > > [email protected]> > > > > For more options, visit this group athttp:// > > > groups.google.com/group/android-developers?hl=en > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<android-developers%2Bunsubs > > > [email protected]> > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

