Hi all,

I am bit confused after reading documentation about
FLAG_ACTIVITY_CLEAR_TOP and  "singleTask" launchMode

In documentation it given as :
{
FLAG_ACTIVITY_CLEAR_TOP
    If the activity being started is already running in the current
task, then instead of launching a new instance of that activity, all
of the other activities on top of it are destroyed and this intent is
delivered to the resumed instance of the activity (now on top),
through onNewIntent()).

    There is no value for the launchMode attribute that produces this
behavior.

}

But i  experimented  FLAG_ACTIVITY_CLEAR_TOP behaviour using
"singleTask" launchMode and i got exactly same . I created 3 activies
Activity_A,Activity_B and Activity_C. In manifest file i set
android:launchMode="singleTask" for activity B. Each activity have a
button to launch next activity ie Activity_A >launches Activity_B
>launches Activity_C >launches Activity_B.

so this is the order in which i launch activity A>B>C>B.

In case of FLAG_ACTIVITY_CLEAR_TOP:
I did A>B>C then as per documentation i started Activity_B from
Activity C using intent with flag FLAG_ACTIVITY_CLEAR_TOP so Activity
C is destroyed and back stack contains A>B .

In case of "singleTask" launchMode in Activity_B:

i followed same procedure as A>B>C>B above instead of
FLAG_ACTIVITY_CLEAR_TOP flag i used singletask launch mode . finally
the back stack contains A>B .

So what is difference between both ?In documentation it says   "There
is no value for the launchMode attribute that produces this behavior
as of FLAG_ACTIVITY_CLEAR_TOP" but I got same behaviour with
"singleTask" launchMode ..

Please clear my understanding ................


Thanks and regards
Mansoor V.M


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to