Search code examples
androidgoogle-playpublishandroid-tv

Unable to open an Android TV application after installing it


I'm working on an Android TV application, after the publishment on Google play store, i could install it on a smart box(MXIII), but i wasn't able to launch it since i could not find the icon, while in the play store there is just uninstall button with no open button.

This is my manifest file :

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

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

<application
    android:name=".AppState"
    android:allowBackup="false"
    android:banner="@drawable/banner"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:logo="@mipmap/ic_launcher"
    android:theme="@style/Theme.Leanback">
    <activity
        android:name=".MainActivity"
        android:icon="@mipmap/ic_launcher"
        android:logo="@mipmap/ic_launcher"
        android:label="@string/title_activity_main">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".PubActivity"
        android:label="@string/title_activity_pub">
    </activity>

    <activity
        android:name=".CodeActivity"
        android:label="@string/title_activity_code"/>

    <activity android:name=".DetailsActivity"/>

</application>

I'm really hopeful to find a solution for my problem, thank you guys.


Solution

  • android.intent.category.LEANBACK_LAUNCHER is for Android TV and select other home screen implementations that elect to honor it. Your device's home screen does not, apparently. Try adding the standard launcher category:

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

    That way, your activity can be opened either way.