After added the singleInstance mode. all of A,B,C are singleInstance, not Hackbod said the application limited only run one activity.
But the question is: singleInstance and singleTask mode will not auto return the last activity page. This means if I launch A from home by MAIN/LAUNCHER and A startActivity B, then return to Home, click my application icon again, it will only call A's onNewIntent->onResume, it will not return to B automatic. How can I get the History stack, and return to B? Best wishes, OCSDN 2009/1/13 Dianne Hackborn <[email protected]> > Please don't use singleInstance, use singleTask instead. Be sure to read > the referenced Application Model doc and have a good understanding of the > repercussions of what you are doing. In particular note this in the doc: > > "The singleInstance launch mode is even more specialized, and should only > be used in applications that are implemented entirely as one activity." > > > On Mon, Jan 12, 2009 at 6:05 PM, John Spurlock <[email protected]>wrote: > >> >> Use android:launchMode="singleInstance" on your Activity element in >> the manifest. >> >> >> http://code.google.com/android/reference/android/R.styleable.html#AndroidManifestActivity_launchMode >> >> On Jan 10, 8:22 am, "[email protected]" <[email protected]> wrote: >> > I have an application with activity A, B, C. A is MAIN/LAUNCHER >> > activity. >> > >> > steps: >> > 1. Start it by click the icon from home, A launched, click a menu, >> > activity B is launched; >> > 2. press HOME key to return home page >> > 3. click my application icon again, it will return the activity B. >> > >> > 4.But if I start A activity from other application, just like from >> > http link, it will start another application instance again, not >> > launch the back ground one. How to avoid this case? I want only a >> > single instance. >> > (If I received an email with ahttp://www.google.com, click this link, >> > chose my application to open, it will create another instance) >> > >> > <application android:icon="@drawable/icon" >> > android:label="@string/app_name"> >> > >> > <activity android:name=".activity.A" >> > android:label="@string/app_name" >> > > >> > >> > <intent-filter> >> > <action android:name="android.intent.action.MAIN" /> >> > <category >> > android:name="android.intent.category.LAUNCHER" /> >> > </intent-filter> >> > <intent-filter> >> > <action android:name="android.intent.action.VIEW" /> >> > <category >> > android:name="android.intent.category.DEFAULT" /> >> > <category >> > android:name="android.intent.category.BROWSABLE" /> >> > <data android:scheme="http" >> > android:host="www.google.com"/> >> > </intent-filter> >> > </activity> >> > >> > <activity android:name=".activity.B" >> > android:label="@string/list" >> > </activity> >> > >> > <activity android:name=".activity.C" >> > android:label="@string/special" >> > </activity> >> >> > > > -- > 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. 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 at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

