Android的回到第一屏 [英] android go back to first screen

查看:158
本文介绍了Android的回到第一屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个链(linkify制造),导致进我的应用程序的其它屏幕的Andr​​oid应用程序。我不知道什么是最好的方法来关闭所有的'孩子'的活动,并返回到最初推出的第一项活动。

I have an android app with links (made by linkify) that lead into other screens of my app. I'm wondering what's the best approach to close all of the 'child' activities and go back to the first activity that was originally launched.

。换句话说是这样的:

HomeScreenActivity =>屏蔽1(通过Linkify链接)=>画面2 =>屏幕3 =>点击首页=>(关闭屏幕1,2和3)=> HomeScreenActivity

HomeScreenActivity => Screen1 (via Linkify-link) => Screen2 => Screen3 => click home => (close screens 1, 2 & 3) => HomeScreenActivity

推荐答案

您应该能够通过为您的HomeScreenActivity与<一个创造的意图来完成这个href="http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP">FLAG_ACTIVITY_CLEAR_TOP旗。

You should be able to accomplish this by creating an intent for your HomeScreenActivity with the FLAG_ACTIVITY_CLEAR_TOP flag.

这篇关于Android的回到第一屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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