说我有3个活动A,B和C. A超前到B这会导致C.我希望能够前后移动,A和B之间,但我要完成A和B,一旦启用C得到启动。我理解如何通过的意图开始C下关闭B,但我怎么也关闭。当C被启动?
Say I have 3 activities A, B and C. A leads to B which leads to C. I would like to be able to move back and forth between A and B but I want to finish both A and B once C gets started. I understand how to close B when starting C via the intent but how do I also close A when C gets started?
使用,当你打开的C活性的研究这个标志。
Use this flag when you are opening the C acitivity.
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
这将清除C的顶部所有活动
This will clear all the activities on top of C.
上一篇:安卓的HttpURLConnection的getInputStream引发NullPointerException异常异常、HttpURLConnection、getInputStream、NullP