从另一项活动整理活动 [英] Finishing Activity from another activity
本文介绍了从另一项活动整理活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我有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.
这篇关于从另一项活动整理活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文