Search code examples
androidlauncher

Why is my app not showing in the list of default launchers?


I have an application where it is going to be the home screen, default launcher. I am implementing this by using the CATEGORY_LAUNCHER in my intent and CATEGORY_HOME in my manifest file, the home activity has ACTION_MAIN and CATEGORY_HOME. Because there are multiple homes set then android prompts the user to select one with the optional extra of selecting a default one. There are many default apps in this list on my emulator but my app is not one of them. Does someone know how to get my app onto the list?

Here is how I am sending the intent:

Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_LAUNCHER);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);

Here the relevant part of the manifest:

<activity
        android:name=".NewHome"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
        </intent-filter>
    </activity>

Solution

  • If you want to show your application in Default launchers. Change your code as:

    <activity
            android:name=".NewHome"
            android:label="@string/title_activity_main" >
            <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>