gpt4 book ai didi

android - 为什么AndroidManifest.xml文件有多余的android :label attributes?

转载 作者:行者123 更新时间:2023-11-29 14:01:15 25 4
gpt4 key购买 nike

The DevGuide在应用程序元素的 android:label 上:

A user-readable label for the application as a whole, and a default label for each of the application's components.

然而,有很多具有以下形式的示例 list

<application ... android:label="@string/app_name">
<activity ... android:label="@string/app_name"> ... </activity>
<activity ... android:label="@string/app_name"> ... </activity>
...
</application>

我拥有的每一本 Android 书籍都这样做,包括 Commonsware 书籍。浏览一下 SDK 示例就会发现 ContactManager 会执行此操作,但 Snake 或 Lunar Lander 不会。

像这样复制属性是否有一些历史原因?或者是像人们在 stub 后代码(以及书籍示例,在一种情况下)中留下的 Eclipse stub 注释一样,或者像我自己的模仿 list 中的重复标签,只是人们没有想到的东西?

最佳答案

我认为带有属性 android:labelactivity 标签不是必需的,除非你想让 Activity 的标题与应用程序标签不同,你可以使用你的自己的标签。默认应与应用程序标签相同。

关于android - 为什么AndroidManifest.xml文件有多余的android :label attributes?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9424277/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com