简体   繁体   English

Android应用程式无法启动图示

[英]Android app no launch icon

I have put together a simple application and when I am installing the app the icon displays but once it's installed there is no launch icon. 我整理了一个简单的应用程序,当我安装该应用程序时,该图标显示出来,但是一旦安装,便没有启动图标。
Here is my AndroidManifest.xml: 这是我的AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.SiteTools.convertme"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />

<application
android:allowBackup="true"
android:icon="@drawable/launch_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>

</manifest>

I have tried renaming the icons but it hasn't helped, I have tested on two devices and neither get the launch icon. 我尝试重命名图标,但没有帮助,我在两台设备上进行了测试,但均未获得启动图标。
I use eclipse. 我用日食。

You need to add an Intent Filter, or else Android won't know what application to launch. 您需要添加一个意图过滤器,否则Android将不知道要启动哪个应用程序。 Also, your application should include the name of the app. 另外,您的应用程序应包括应用程序的名称。 I've included a name below as someActivity , change it to your app as appropriate. 我在下面添加了一个名称,名为someActivity ,并根据someActivity将其更改为您的应用。 This can be done by changing your application to the following: 可以通过将应用程序更改为以下内容来完成此操作:

<application
android:allowBackup="true"
android:icon="@drawable/launch_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
    <activity 
        android:name="someActivity"
        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>

Did you create icons for all resolutions ? 您是否为所有分辨率创建了图标? . Under your res folder add the appropiate icon size for each folder. 在res文件夹下,为每个文件夹添加适当的图标大小。

drawable-hdpi drawable-ldpi drawable-mdpi drawable-xhdpi drawable-hdpidrawable-ldpidrawable-mdpidrawable-xhdpi

Your device should pick it up from there according to its resolution 您的设备应根据其分辨率从那里拿起它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM