Intent 标志
FLAG_ACTIVITY_REORDER_TO_FRONT
If set in an Intent passed to Context.startActivity()
, this flag will cause the launched activity to be brought to the front of its task's history stack if it is already running.
Intent Intent = new Intent();
Intent.setClass(A.this, B.class);
intent.addFlag(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
A.startActivity(intent);
如果B 实例存在历史的堆栈中, 将会调用在A 之上的位置(在堆栈中).
目的: 防止重复实例的生成