android - Multiple activity instances and FLAG_ACTIVITY_REORDER_TO_FRONT -


suppose current task stacks has 4 activity instances, a0, a1, b0, c0, c0 @ top of stack. a0, a1 instances of activity a, b0 instance of activity b, , c0 instance of activity c0.

now c0 creates intent flag_activity_reorder_to_front , starts activity a:

intent intent = new intent(this, a.class); intent.setflag(intent.flag_activity_reorder_to_front); startactivity(intent); 

my question is, instance brought front, a0 or a1? task stacks become a0, b0, c0, a1 or a1, b0, c0, a0?

thanks.

empirical evidence says brings most recent instance front. in example, if activity stack starts out this:

 a0, a1, b0, c0 (front of task) 

and c0 starts intent.flag_activity_reorder_to_front, instance a1 brought front , activity stack looks this:

a0, b0, c0, a1 

when use flag, android looks instance of activity (starting front of task , scanning back/root of task). first instance finds brought front. if doesn't find instance in activity stack create new one.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -