如何破坏活动previous活动? [英] How to destroy previous activity in Activity?

查看:98
本文介绍了如何破坏活动previous活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有四个活动,即A,B,C和D来启动B,B启动C,C启动D.当C被启动研发,我想摧毁b活动视情况而定(逻辑的将保持在活性C),这样,当我回去从研发,它会跟D-> C->的路径。所以我想毁从C b活动是如何可能?

I have four activity, i.e. A, B, C and D. A launches B, B launches C, C launches D. When C is launching D, I want to destroy the activity B depending on the situation(logic for that will remain in activity C) so that when I go back From D, it will follow D->C->A path. So I want to destroy activity B from C. How it is possible?

推荐答案

完成活动时,您呼叫的活动C B取决于你的逻辑。 例如

finish Activity B when you are calling Activity C depends on your logic. For example

if(true){
Intent in = new Intent(B.this,c.class);
startActivity(c);
}
else
{
Intent in = new Intent(B.this,c.class);
startActivity(c);
finish();
}

这篇关于如何破坏活动previous活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆