我正在开发一款安卓游戏。
它工作正常,但我有一个问题,如果我从我的android manifest
我的应用程序图标可见。如果我不删除这些行,那么我的应用程序图标在我的 Android 上将不可见。
<data android:host="mocha" android:path="/RTT/reset"
android:scheme="content" />
这是我原来的 android 清单,其中图标不可见:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ihpc.mocha.rtt"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="12" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name="com.game.rtt.RttGame"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.NoTitleBar" >
<activity
android:screenOrientation="sensorLandscape"
android:name=".MainScene"
android:label="@string/title_activity_main_scene" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- remove below lines to visible the icon start!!!-->
<data
android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
<!-- remove below lines to visible the icon end!!!-->
</intent-filter>
</activity>
<activity
android:name=".SessionTimeOutActivity"
android:label="@string/app_name"
android:screenOrientation="reverseLandscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="mocha"
android:path="/RTT/sessionTimeOut"
android:scheme="content" />
</intent-filter>
</activity>
</application>
</manifest>
请告诉我同样的原因?
As of “使用意图匹配” http://developer.android.com/guide/components/intents-filters.html#imatch:
“意图与意图过滤器相匹配,不仅可以发现要激活的目标组件,还可以发现有关设备上组件集的某些信息。例如,Android 系统填充应用程序启动器,即显示可供用户启动的应用程序,通过查找具有指定“android.intent.action.MAIN”操作和“android.intent.category.LAUNCHER”类别的意图过滤器的所有活动(如上一节所示)然后它在启动器中显示这些活动的图标和标签。同样,它通过在过滤器中查找带有“android.intent.category.HOME”的活动来发现主屏幕。
应用程序启动器无法识别您的启动器活动,因为您为您的活动假设了一些数据。请在您请求数据的位置添加一个新的意图过滤器。
Example:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/json"/>
</intent-filter>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)