
我的清单文件看起来像这样.
<application androID:icon="@drawable/icon" androID:label="@string/app_name" androID:deBUGgable="true"> <activity androID:name=".MainAct" androID:label="@string/app_name"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity androID:name=".StartGame" androID:label="@string/app_name"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity androID:name=".Instructions" androID:label="@string/app_name"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity androID:name=".About" androID:label="@string/app_name"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity></application>解决方法 您不需要为所有活动重复这些行;
<intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter>
只为主要的一个
(作为评论问题的广告:
来自:http://developer.android.com/guide/topics/manifest/manifest-intro.html
总结The icon and label set for an intent filter are used to represent a component whenever the component is presented to the user as fulfilling the function advertised by the filter. For example,a filter with “androID.intent.action.MAIN” and “androID.intent.category.LAUNCHER” settings advertises an activity as one that initiates an application — that is,as one that should be displayed in the application launcher. The icon and label set in the filter are therefore the ones displayed in the launcher.
以上是内存溢出为你收集整理的android – 为什么模拟器中的菜单按钮显示我的应用程序的所有活动?全部内容,希望文章能够帮你解决android – 为什么模拟器中的菜单按钮显示我的应用程序的所有活动?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)