I have an app that should run on both phone and TV. In the manifest, I'm specifying the phone's launch activity with
<activity
android:name=".view.phone.MainActivity"
android:launchMode="singleTop"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and the TV's launch activity with
<activity
android:name=".view.leanback.MainActivity"
android:launchMode="singleTop"
android:label="@string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
Instead of filtering between LAUNCHER & LEANBACK_LAUNCHER, on either device it just goes with whichever activity is declared first in the manifest. Any ideas what I'm doing wrong?
Solution for me was to create 2 launch configuration like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With