我是新来的Android,开始了活动的一个 - B - C - D.从活动的研发,当我再次打开活性的话,我怎么能启动,以便活动B和C不完成和A再次启动?应该只有一个活动一个。
I am new to Android and started the activities A - B - C - D. From activity D, when I open activity A again then how can I start so that activities B and C don't finish and A starts again? There should only be one activity A.
在此先感谢。
使用了意图国旗
FLAG_ACTIVITY_REORDER_TO_FRONT
在D中
Intent i = new Intent(ActivityD.this, ActivityA.class);
i.setFlags(FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(i);
这只会带来 ActivityA
到堆栈的前面,留下 B
和 ç
他们在哪里我相信这是你想要的。然后,你可以明显地调用完成()
D上,如果你想从堆栈中取出。
This will simply bring ActivityA
to the front of the stack and leave B
and C
where they are which I believe is what you want. Then you can obviously call finish()
on D if you want to remove it from the stack.
您可以找到意向文档
下一篇:通过GPS坐标来活动坐标、GPS