我必须指定Android清单父活动叫什么名字? [英] Must I specify the parent activity name in the Android Manifest?

查看:156
本文介绍了我必须指定Android清单父活动叫什么名字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启动另一个活动的活动。 这是必须通过我指定的Andr​​oid清单父活动? 我要问这个,因为可能还有其他的活动,将启动该之一,也是,所以我应该指定其中的呢?

 安卓parentActivityName =com.example.myfirstapp.MainActivity
 

解决方案

您只需指定,如果你打算使用最多导航(如按后退按钮而不是导航)。在其他情况下,你不需要它。

请在这里约了导航:<一href="http://developer.android.com/design/patterns/navigation.html">http://developer.android.com/design/patterns/navigation.html

I have an activity that starts another activity. Is it mandatory that I specify the parent activity in the Android Manifest? Im asking this because there might be other activities that will start this one as well, so should I specify all of them?

    android:parentActivityName="com.example.myfirstapp.MainActivity" 

解决方案

You only need to specify that if you're going to use up-navigation (as opposed to navigation by back button). In other cases, you don't need it.

Check in here about up-navigation: http://developer.android.com/design/patterns/navigation.html

这篇关于我必须指定Android清单父活动叫什么名字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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