Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

HeaderItem

public class HeaderItem
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.widget.HeaderItem


A header item describes the metadata of a Row, such as a category of media items. May be subclassed to add more information.

Summary

Public constructors

HeaderItem(long id, String name)

Create a header item.

HeaderItem(String name)

Create a header item.

Public methods

CharSequence getContentDescription()

Returns optional content description for the HeaderItem.

CharSequence getDescription()

Returns the description for the current row.

final long getId()

Returns a unique identifier for this item.

final String getName()

Returns the name of this header item.

void setContentDescription(CharSequence contentDescription)

Sets optional content description for the HeaderItem.

void setDescription(CharSequence description)

Sets the description for the current header item.

Inherited methods

From class java.lang.Object

Public constructors

HeaderItem

added in version 22.1.0
HeaderItem (long id, 
                String name)

Create a header item. All fields are optional.

Parameters
id long

name String

HeaderItem

added in version 22.1.0
HeaderItem (String name)

Create a header item.

Parameters
name String

Public methods

getContentDescription

added in version 24.1.0
CharSequence getContentDescription ()

Returns optional content description for the HeaderItem. When it is null, getName() should be used for the content description.

Returns
CharSequence Content description for the HeaderItem.

getDescription

added in version 25.1.0
CharSequence getDescription ()

Returns the description for the current row.

Returns
CharSequence

getId

added in version 22.1.0
long getId ()

Returns a unique identifier for this item.

Returns
long

getName

added in version 22.1.0
String getName ()

Returns the name of this header item.

Returns
String

setContentDescription

added in version 24.1.0
void setContentDescription (CharSequence contentDescription)

Sets optional content description for the HeaderItem.

Parameters
contentDescription CharSequence: Content description sets on the HeaderItem.

setDescription

added in version 25.1.0
void setDescription (CharSequence description)

Sets the description for the current header item. This will be visible when the row receives focus.

Parameters
description CharSequence

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)