I have an application that should work both on the phone and on the TV. In the manifest, I indicate the activity of starting the phone 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 activity of starting the TV using
<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 and LEANBACK_LAUNCHER, on any device it simply goes to the activity that was declared first in the manifest. Any ideas what I'm doing wrong?
android android-tv android-manifest
Tim mutton
source share