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)