Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove headers from BrowseFragment?

I am working on an android TV app and I am using the leanback library.

I want to customize the app layout "BrowseFragment". I want to remove the header view and only display the card list "rows".

Is it possible to do that or is there any other solution to achieve that?

I want to remove that

like image 414
Billel Boumessaidia Avatar asked May 03 '18 10:05

Billel Boumessaidia


2 Answers

The above call actually needs to be in the OnCreate method instead of OnActivityCreated.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHeadersState(HEADERS_DISABLED);
}
like image 190
ebr Avatar answered Nov 09 '22 09:11

ebr


You have to set the HeaderState like this:

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setHeadersState(HEADERS_DISABLED); // Add this line
}
like image 38
Sofiane Daoud Avatar answered Nov 09 '22 07:11

Sofiane Daoud