Android应用程序名称显示为活动名称 [英] Android Application Name Appears as Activity Name

查看:154
本文介绍了Android应用程序名称显示为活动名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已审阅清单的应用程序,并在应用启动其显示为活动名称,而不是它的应用程序的名称?为什么是这样。我在那里,当我安装其它应用程序中,有5项一为应用程序中的每一个活动时,应该只有一个名字,该应用程序的?所以,当我去启动它有5个在推出清单同名的应用程序。这些被命名为应用程序后,但有一个为每个活动。可能是什么原因呢?

I have reviewed the manifest for application, and under apps launcher it displays as Activity Name rather than its app name? Why is this. I have another application where when I install it, there are 5 entries one for each activity in the application when there should be just one name, that of the app? So when I go to launch it has 5 identically named apps in the launch list. These are named after the app but there is one for each activity. What could be the reason for this?

推荐答案

对于第一个问题,你应该知道,这个名字来源于安卓标签属性上应用程序标记:

For the first issue, you should be aware that the name comes from the android:label attribute on the application tag:

<application android:name="ApiDemosApplication"
   android:label="@string/activity_sample_code"
   android:icon="@drawable/app_sample_code">

对于第二个问题,在清单中,它很可能是所有的活动与android.intent.category.LAUNCHER的动作指定一个意图过滤器。例如:

For the second issue, in the manifest, it is likely that all your activities specify an intent filter with an action of android.intent.category.LAUNCHER. For example:

<activity android:name="ApiDemos">
     <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
</activity>

如果您对所有的活动,意图过滤器标签,你应该拿出意图过滤器标签上要启动在启动时所有,但活动。

If you have such intent-filter tags on all activities, you should take out the intent filter tags on all but the Activity that you want to launch at startup.

这篇关于Android应用程序名称显示为活动名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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