Search code examples
androidandroid-tvleanback

cannot find my installed application on LDplayer why?


enter image description herei have a TV android application created on android studio, when i run it into LDplayer cannot find the icon of it in the whole emulator. It is installed successfully but my problem is i cannot find the icon anyone know why?

the image show how there is no any app installed, but i just run it from android studio and it is successfully installed !!

below the manifest

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

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
    android:name=".App"
    android:allowBackup="true"
    android:icon="@drawable/banner"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/Theme.Leanback"
    android:usesCleartextTraffic="true">
    <activity android:name=".ui.search.SearchActivity" />
    <activity
        android:name=".ui.player.PlayerActivity"
        android:usesCleartextTraffic="true"
        tools:targetApi="m" />
    <activity
        android:name=".ui.main.LandingActivity"
        android:banner="@drawable/banner"
        android:icon="@drawable/banner"
        android:logo="@drawable/banner"
        android:screenOrientation="landscape"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".ui.detail.DetailActivity" />
    <activity android:name=".ui.main.MainActivity" />
</application>
<uses-feature
    android:name="android.hardware.touchscreen"
    android:required="false" />

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

Solution

  • You have:

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

    That will work for Android TV and perhaps other TV platforms (e.g., Amazon Fire TV). It will not work for ordinary Android devices, and that will include most emulators. You need to add a second <intent-filter> — the standard one that you see in just about every Android app:

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

    That assumes that you want the same activity to be used as the launcher activity on phones as well as TVs. If you want a different activity to be the launcher activity on phones, put the LAUNCHER <intent-filter> on it.

    Conversely, it may be that you only want to support TVs. That's fine, but then you will want to limit yourself to emulators that are actually emulating an Android TV or similar environment.