This is a followup question.  The docs for
LocalActivityManager.startActivity() say -

"If the current activity uses a non-multiple launch mode (such as
singleTop), or the Intent has the FLAG_ACTIVITY_SINGLE_TOP flag set,
then the current activity will remain running and its
Activity.onNewIntent() method called. "

Two confusions here: (1) singleTop is a multiple (not a non-multiple)
launch mode as I understand it.  I assume this should read
"singleTask" instead of "singleTop".  (2) "current activity"
apparently means "previous activity with the same id" which might not
be the currently running activity returned by the getCurrentActivity()
method.

I think what the passage means is that if you set singleTop launch
mode then it will resume the previous activity rather than recreating
it whether or not it is the currently running (top) acrtivity.
Otherwise there would not be a way to resume the previous Activity
unless it was a non-multiple launch mode.  Is that right?



On Nov 23, 11:06 am, chentschel <[email protected]> wrote:
> Thanks Dianne. Did you mean that usage ofActivityGroupand childs
> activities are somehow discouraged.?
>
> I had a sort of tabs before (implemented by buttons in layout), but
> code was ugly and full of switch/case to handle changes to different
> views/adapters, etc. so I changed toActivityGroupimplementation. It
> seemed more coherent to the android activities/adapters coding model.
>
> CH
>
> On Nov 23, 2:33 pm, Dianne Hackborn <[email protected]> wrote:
>
> > It is trying to mimic the the behavior of normal activities -- if you start
> > an activity, this will start on top (or here replace) the current one,
> > unless its launch mode is singleTop.  It seems there is a bug where it is
> > ignoring the single top flag.  This should be fixed, but note that activity
> > groups and child activities are a little odd in that the code driving them
> > is completely different than top-level activities, so there can be many
> > subtle differences in behavior between the two.
>
> > On Mon, Nov 23, 2009 at 7:45 AM, chentschel <[email protected]> wrote:
> > > Update on this: Setting 'android:launchMode="singleTop"' at the sub-
> > > activity definition on the manifest file. Solves my problem.
>
> > > Can someone shed a light on this?.
>
> > > Thanks.
> > > CH
>
> > > On Nov 23, 11:59 am, chentschel <[email protected]> wrote:
> > > > Hi!,
> > > >    I'm extendingActivityGroupclass and implemented a custom tabHost
> > > > and widgets for my app. Can someone shed a light on how are the
> > > > Activities fife-time inside anActivityGroup?.
>
> > > > Im getting a weird behavior when using the following code to send a
> > > > new intent to the current sub-activity, then change tab, and getting
> > > > back to original tab. (TAB1 -> TAB2 -> TAB1)
>
> > > > LocalActivityManager lm = getLocalActivityManager();
>
> > > > Intent i = new Intent(this, lm.getCurrentActivity().getClass());
> > > > i.setAction(WeegohApp.INTENT_ACTION_FILTER_SHC);
> > > > i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
>
> > > > lm.startActivity(tabHost.getCurrentTabTag(), i);
>
> > > > What i see from debug..
>
> > > > onSaveInstanceState() is called on TAB1, then TAB2 is current
> > > > subActivity, but when going back to TAB1 onCreate() is called.
>
> > > > onCreate() is not called with the same test without using the
> > > > onNewIntent() described above.
>
> > > > Thanks in advance !
> > > > CH
>
> > > --
> > > 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%[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 at
http://groups.google.com/group/android-developers?hl=en

Reply via email to