【发布时间】:2021-06-01 11:36:07
【问题描述】:
我正在尝试将启动器图标添加到我的 Android 应用程序。我已经在线观看了多个教程,这些教程解释了它是如何工作的。我最终这样做了: https://www.youtube.com/watch?v=DQ8HDL-X9rM
laucher 图标确实出现在 android 模拟器中,但不会出现在实体手机上。 我试图做的事情:
- 在 android studio 中清理构建
- 按照教程中的说明重置图标
- 检查了 android manifest 中的引用
- 检查drawable和mipmap文件夹中的图标是否改变
这是几年前在 stackoverflow 主题中出现的提示。 过去一周我一直在努力,但我无法让它发挥作用。
这是我的 ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher"/>
</adaptive-icon>
这是我的 AndroidManifest 中的行
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
<activity android:name="com.example.fragments.Product">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.MainActivity" />
</activity>
<activity android:name="com.example.MainActivity">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
我还检查了所有 mipmap 文件夹,我的所有图标都在其中,名称正确。
有人知道我能做什么吗?
---更新 6 月 3 日---
现在它甚至不再出现在模拟器上...... 我已经尝试并阅读了所有在线主题我真的希望有人能发现我做错了什么
【问题讨论】:
-
清单中的主要活动是否有
intent-filter和<category android:name="android.intent.category.LAUNCHER"/> <action android:name="android.intent.action.MAIN"/>? -
是的。它在
里面 它是错误的顺序然后是你发送的 -
请在清单中发布您的入口点活动的条目。
-
我是 android 开发新手,所以我不知道你的意思,所以我发布了整个 AndroidManifest 文件
标签: android android-emulator icons