intent filter category android.intent.category.default Default Activity not found

1.4k Views Asked by At
         <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen">
    <activity android:name=".MainActivity"
        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=".AppListActivity"/>
</application>

here android.category.default is used to make this application as default launcher like google launcher but when running this application its throwing error default activity not found...i have tried restarting and invalidating cache several times. can anyone help me...?

3

There are 3 best solutions below

0
On BEST ANSWER

you can use this,

 <activity android:name=".MainActivity"
    android:launchMode="singleInstance"
    android:stateNotNeeded="true">
    <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.HOME" />
    </intent-filter>
</activity>
0
On

Go to Edit Configurations. Within the General tab, in the launch options drop down, select nothing. Now run the app.

You can use Control + Shift + A on Windows or Command + Shift + A on Mac, and type edit configurations to open it.

0
On

Just specify activity to lunch in android studio. To do that click on run configuration -> Edit configurations.

In Launch Options pick Specified Activity and then select your activity.

enter image description here