5

I'm new in TV layout design. According to reference, TV application use Leanback theme system wide and provide some widget and class specially developed for TV. But Leanback has very limited features.

I want to create a layout with TabLayout which provide by AppCompact. For that the activity must use AppCompact theme but in Fragment I am using BrowserFragment provide by Leanback. So when I add AppCompact in activity, fragment crash with layout parameter issue.

Binary XML file line #21: Binary XML file line #21: You must supply a layout_width attribute.

Is it not possible to use both theme in TV application?

shantanu
  • 2,408
  • 2
  • 26
  • 56
  • It's default application created by Android studio for TV. I just call Fragment from a Activity. If activity use AppCompact theme then application crash with this error. If I use Leanback for the activity then everything is fine. It's not layout, it's Theme. BrowserFragment use Leanback but I am using AppCompact, that's the conflict. – shantanu Jul 17 '16 at 11:12
  • 1) Can you supply a sample code? 2) Have you noticed that error message says that your layout is missing layout_width attribute somewhere? – ULazdins Jul 18 '16 at 05:44
  • did you find any solution? – faraz khonsari Apr 12 '17 at 11:02
  • 1
    i am also looking for same answer. I want to use TabLayout for TV apps. – Mamta Kaundal Oct 23 '17 at 07:05
  • Did you guys find any solution? – Hassan Imtiaz Sep 15 '21 at 09:13

0 Answers0