1

I am trying to create a default launcher app for Android TV box. Here is the manifest:

    <?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.raza.mlauncher">

    <uses-feature
        android:name="android.software.leanback"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

    <queries>
        <intent>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
        </intent>
    </queries>

    <application
        android:allowBackup="true"
        android:banner="@mipmap/ic_launcher"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar">
        <activity
            android:launchMode="singleTask"
            android:name=".MainActivity"
            android:exported="true"
            android:priority="2">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.MONKEY" />
            </intent-filter>
        </activity>
    </application>

</manifest>

But when I press home button on Android TV simulator, it does not ask to select the default home app. Even in settings of the device, there is no option available to choose a default launcher from installed ones. Is there any limitation on creating launcher apps for Android TV boxes?

Khawar Raza
  • 15,870
  • 24
  • 70
  • 127
  • Android will not ask you to set the default launcher unless you clear the default. AFAIK, In android TV, the launcher is set as default in image so, you should first remove the default, and then the selection dialog will appear. – mahdi Aug 09 '22 at 09:36
  • Does this answer your question? [How can I create a custom home-screen replacement application for Android?](https://stackoverflow.com/questions/3666771/how-can-i-create-a-custom-home-screen-replacement-application-for-android) – Neil Turner Aug 23 '22 at 16:05
  • Hi, am also facing the same issue. Do you have any solution regarding this. Thank you in advance. – Mr_vmh Jun 05 '23 at 13:17

1 Answers1

0

Shouldn't leanback be set to true?

<uses-feature
    android:name="android.software.leanback"
    android:required="true" />
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 08 '23 at 16:01