Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Behaviour of launchMode "singleTop" in Activity (manifest)

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 159
    Comment on it

    How launchmode parameter in activity behaves

     

    <activity android:name=.FirstActivity
     android:launchMode=singleTop></activity>

     

    Let us assume different activity as A ,B ,C ,D ,E

     

    1   android:launchMode=”singleTop”

        Let us assume the state of activity in a stack.

      

     D - D is on top of Activity Stack

     C

     B

     A

     

    Starting D from another part of  application (like in service)

    Final Activity Stack state

    D - old instance of d activity gets extras data through onNewIntent(Intent newintent);

    C

    B

    A

    Eg Two:

    Assuming activity in stack as follows

    C

    B

    A

    Starting  D from other part of  application (like in service)

    Final Activity Stack state

    D -starts as usual.

    C

    B

    A

     

     

    Eg 3

    Assuming activity in stack

    C

    D

    B

    A

    Start D from C

    Final Activity Stack state

    D -old  object of D gets extras data through onNewIntent(Intent newIntent);

    C

    B

    A

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: