我安装了Android Studio,并制作了一个简单的应用程序。
当我在手机上安装APK文件时,它安装正常,但主屏幕上没有任何应用程序图标。
之前已经有人问过这个问题,答案是我的AndroidManifest.xml中需要以下几行
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
他们已经在那里。这是我完整的AndroidManifest代码:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pizza.learn.learnpizza">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".FullscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
知道我在做什么错吗?
最佳答案
请在清单文件中更改....
android:icon="@mipmap/ic_launcher"
将ic_launcher替换为
android:icon="@mipmap/ic_launcher_round"
并从清单文件中删除此行
android:roundIcon="@mipmap/ic_launcher_round"