简体   繁体   English

Android Launcher图标未显示

[英]Android Launcher icon not showing

I have a problem with my app launcher icon. 我的应用启动器图标有问题。 Launcher icon is not shown on device. 设备上未显示启动器图标。 Here is my AndroidManifest.xml: 这是我的AndroidManifest.xml:

<application
    android:allowBackup="true"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:name=".HamrahBankAnsarApplication"
    android:theme="@style/AppTheme">

    <activity
        android:name=".activity.LoginActivity"
        android:label="@string/app_name"
        android:configChanges="orientation|keyboardHidden"
        android:launchMode="singleTop"
        android:clearTaskOnLaunch="true"
        android:screenOrientation="landscape"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".activity.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="landscape"
        android:configChanges="orientation|keyboardHidden"
        android:finishOnTaskLaunch="true" >
    </activity>

</application>

The confusing point is when I move 令人困惑的是我搬家的时候
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
to the MainActivity tag, the launcher icon is displayed. 在MainActivity标签中,显示启动器图标。 But the launcher activity is LoginActivity and it must be opened before MainActivity. 但是启动器活动是LoginActivity,它必须在MainActivity之前打开。
Can anybody help me with this problem? 任何人都可以帮我解决这个问题吗?
Thanks in advance. 提前致谢。

Make sure your icon is in all resolution folders like below: 确保您的图标位于以下所有分辨率文件夹中:

 res/...
    mipmap-ldpi/...
        ic_launcher.png
    mipmap-mdpi/...
        ic_launcher.png
    mipmap-hdpi/...
        ic_launcher.png
    mipmap-xhdpi/...
        ic_launcher.png
    mipmap-xxhdpi/...
        ic_launcher.png

set below the line in your application tag below android:icon="@mipmap/ic_launcher" 设置在android:icon="@mipmap/ic_launcher"下面的应用程序标签中的行下方

    android:roundIcon="@mipmap/ic_launcher"

It will help you a lot. 它会帮助你很多。 Happy Coding!!! 快乐的编码!!!

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

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