Thursday, February 20, 2014

android: launchMode = "singleTask" problems



SingleTask between the two switching
Activity
Why after the start of the Activity will create a new instance of it?

That is:
A and B each jump,
A.startActivity (intent) ---> B.startActivity (intent) -----> A. ......
B every time a new instance of,

singleTask not looking too instantiated in the Activity in Task what?
I got it wrong?

Solving!<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
You from B -> A time is how to exit the country. You estimate is based on the "back" button bar. In that case, by default, B will call onDestroy method destroyed.
Reply:
cited a floor liu_xiao_su reply:
you from B -> A time is how to exit the country. You estimate is based on the "back" button bar. In that case, by default, B will call onDestroy method destroyed.


Instead of,

A.startActivity (intent) ---> B.startActivity (intent) -----> A. ......
Been startActivity (intent) to go,

Did not finish () or back up
Reply:
Supreme answer Ah ~ ~
Reply:
If A and B are singleTask of activity is there such a situation.

Because singleTask the activity must be at the bottom of the task, assuming taskA have a activityA (1) When the A (1) -> B will create a taskB put into them ACTIVITY B, when B-> A (2), the Due to the current TASKB only one activity B, and the beginning of the A (1) and therefore can not be reused in the taskA. So, will the renewed a TASKC ACTIVITY A (2) bag.

I do not know did not explain.
Reply:
references, 4th Floor fishmen26 reply:
If A and B are singleTask of activity is there such a situation.

Because singleTask the activity must be at the bottom of the task, assuming taskA have a activityA (1) When the A (1) -> B will create a taskB put into them ACTIVITY B, when B-> A (2), the Due to the current TASKB only one activity B, and the beginning of the A (1) it is not in taskA in heavy ......


Hungry, did not understand taskA and taskB
Why would he do New Task? SingleTask the current mode is just like his name is a single case of ah
Did not understand ah .....
Reply:
singleTask indicates that the activity at any time at the bottom of the stack. Not a single case of the mean.

Two activity are singleTask of mutual startActivity, only to re-establish a new stack to ensure that they are in the bottom of each stack
Reply:
mark it, learn

No comments:

Post a Comment