Reputation: 4188
I have an app that I am wanting to be supported by Android TV (the app currently supports phone and tablet)
The main activity is pretty basic, and whilst it does have two text inputs (for an account login) I'm certain it is usable on Android TV (seems to work on the emulator, yet to test on a real Android TV).
So in this case, in my manifest, should I be setting an intent for both LAUNCHER
and LEANBACK_LAUNCHER
?
Or should I just set the intent for LEANBACK_LAUNCHER
?
Upvotes: 3
Views: 1331
Reputation: 4227
don't forget "Declare Leanback support"
from developer website " If you are developing an app that runs on mobile (phones, wearables, tablets, etc.) as well as Android TV, set the required
attribute value to false. If you set the required
attribute value to true, your app will run only on devices that use the Leanback UI."
<manifest>
<uses-feature android:name="android.software.leanback"
android:required="false" />
...
Upvotes: 0
Reputation: 32780
You need to specify both the categories:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
BTW is not recommended to use the same activity layout:
If you are modifying an existing app for use on TV, your app should not use the same activity layout for TV that it does for phones and tablets. The user interface of your TV app (or TV portion of your existing app) should provide a simpler interface that can be easily navigated using a remote control from a couch. For guidelines on designing an app for TV, see the TV Design guide. For more information on the minimum implementation requirements for interface layouts on TV, see Building TV Layouts.
Reference:
http://developer.android.com/training/tv/start/start.html#tv-activity
Upvotes: 5