错误 运行 应用程序:未找到默认值 Activity (Android)

Error running app: Default Activity not found (Android)

我在这个地方发现了同样的问题,但所有答案对我都不起作用(如果我这样做,它会起作用:Select 菜单 Run -> Edit Configurations)。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.package.launcher">
<application>
    <activity
        android:name=".HomeActivity"
        android:label="Launcher"
        android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
        android:launchMode="singleTask"
        android:stateNotNeeded="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".AppsListActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity>
</application>

我写错了吗?请指点一下。

<intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

你想念<category android:name="android.intent.category.LAUNCHER" />

使用以下代码更改您的代码。您需要在 Manifest 文件的 activity 标签中添加 <category android:name="android.intent.category.LAUNCHER" />

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.package.launcher">
<application>
    <activity
        android:name=".HomeActivity"
        android:label="Launcher"
        android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
        android:launchMode="singleTask"
        android:stateNotNeeded="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            //Add this line
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".AppsListActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity>
</application>

在您的 Intent-filter 中添加以下行

 <category android:name="android.intent.category.LAUNCHER" />

<intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.HOME" />
        <category android:name="android.intent.category.DEFAULT" />
        **<category android:name="android.intent.category.LAUNCHER" />**
    </intent-filter>

您没有在 intent-filter 中添加

<category android:name="android.intent.category.LAUNCHER" />