如何回来的第三个活动的第一项活动? [英] How to come back to first activity from third activity?

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

问题描述

我有三个活动A,B和; C.Now的任务,我有这种形式的A,B和C,在默认的Andr​​oid标准模式下的活动导航发生这样的A-> B-> C-> B-> A.Now我想在这里是当我去到活动C来自B,当我回到pressed在活动我去previous活动即,B,但我想回来到A从C.How实现这个任何人都可以告诉这个?

I have three activities A,B & C.Now the Task i have this form A,B and C,in default android "standard"mode The activities navigation takes place like this A->B->C->B->A.Now What I want here is when I went to Activity C from B,when i backPressed In activity I went to previous Activity i.e.,B But i want to come back to A from C.How to achieve this could anyone tell about this??

,我想通过做标志的意图或者如果可能的话想申请launchmodes的活动,但我很困惑,它发射方式,我应该用它来实现这一目标?-could任何一个,请帮我在这

,I want to do through intent flags or if possible want to apply launchmodes for the activities,But i am confused which launch mode should i use to achieve this ?-could any one please help me in this

在此先感谢

推荐答案

刚刚推出一个新的意图并清除活动的堆栈中。

Just launch a new intent and clear the activities on the stack.

 Intent intent = new Intent(this, A.class);
 intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 startActivity(intent);

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

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