- Intent Intent = new Intent (A. This, B.class);
- Intent.setflags (Intent.flag_activity_reorder_to_front | Intent.flag_activity_previous_is_top);
Intent.flag_activity_reorder_to_front:
If set Context.startActivity() in a Intent passed to, this flag would cause the launched activity to being brought to the front of its task ' s h Istory Stack If it is already running.
For example, consider a task consisting of four activities:a, B, C, D. If D calls StartActivity () with an Intent that res Olves to the component of activity B, then B'll be brought to the front of the "history" stack, with this resulting order: A, C, D, B. This flag would be ignored if is FLAG_ACTIVITY_CLEAR_TOP also specified.
When you turn on four activity A, B, C, D (no finish), if you want to startactivity B at D, then the system detects that B is already in the task stack and mentions B to the top of the stack, and the process is not new B.
[Android] Activity re-use