Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Header

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/preference/PreferenceActivity.Header "View this page in Java")

```
class Header : Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.preference.PreferenceActivity.Header](https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#) |

*** ** * ** ***

> [!CAUTION]
> **This class was deprecated in API level 29.**
>
> Use the [AndroidX](https://developer.android.com/jetpack/androidx.html) [Preference Library](https://developer.android.com/reference/androidx/preference/package-summary.html) for consistent behavior across all devices. For more information on using the AndroidX Preference Library see [Settings](https://developer.android.com/guide/topics/ui/settings.html).

Description of a single Header item that the user can select.

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#Header()()` <br /> |

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#getBreadCrumbShortTitle(android.content.res.Resources)(res: https://developer.android.com/reference/kotlin/android/content/res/Resources.html#!)` Return the currently set bread crumb short title. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#getBreadCrumbTitle(android.content.res.Resources)(res: https://developer.android.com/reference/kotlin/android/content/res/Resources.html#!)` Return the currently set bread crumb title. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#getSummary(android.content.res.Resources)(res: https://developer.android.com/reference/kotlin/android/content/res/Resources.html#!)` Return the currently set summary. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#getTitle(android.content.res.Resources)(res: https://developer.android.com/reference/kotlin/android/content/res/Resources.html#!)` Return the currently set title. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#readFromParcel(android.os.Parcel)(in: https://developer.android.com/reference/kotlin/android/os/Parcel.html#!)` <br /> |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[PreferenceActivity.Header](https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#)!\> | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#CREATOR:android.os.Parcelable.Creator` <br /> |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbShortTitle:kotlin.CharSequence` Optional text to show as the short title in the bread crumb. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbShortTitleRes:kotlin.Int` Resource ID of optional text to show as the short title in the bread crumb. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbTitle:kotlin.CharSequence` Optional text to show as the title in the bread crumb. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbTitleRes:kotlin.Int` Resource ID of optional text to show as the title in the bread crumb. |
| [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#extras:android.os.Bundle` Optional additional data for use by subclasses of PreferenceActivity. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#fragment:kotlin.String` Full class name of the fragment to display when this header is selected. |
| [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#fragmentArguments:android.os.Bundle` Optional arguments to supply to the fragment when it is instantiated. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#iconRes:kotlin.Int` Optional icon resource to show for this header. |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#id:kotlin.Long` Identifier for this header, to correlate with a new list when it is updated. |
| [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#intent:android.content.Intent` Intent to launch when the preference is selected. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#summary:kotlin.CharSequence` Optional summary describing what this header controls. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#summaryRes:kotlin.Int` Resource ID of optional summary describing what this header controls. |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#title:kotlin.CharSequence` Title of the header that is shown to the user. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#titleRes:kotlin.Int` Resource ID of title of the header that is shown to the user. |

## Public constructors

### Header

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Header()
```

## Public methods

### describeContents

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun describeContents(): Int
```

**Deprecated:** *Deprecated in Java.*

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getBreadCrumbShortTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getBreadCrumbShortTitle(res: Resources!): CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Return the currently set bread crumb short title. If `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbShortTitleRes:kotlin.Int` is set, this resource is loaded from res and returned. Otherwise `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbShortTitle:kotlin.CharSequence` is returned.

### getBreadCrumbTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getBreadCrumbTitle(res: Resources!): CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Return the currently set bread crumb title. If `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbTitleRes:kotlin.Int` is set, this resource is loaded from res and returned. Otherwise `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#breadCrumbTitle:kotlin.CharSequence` is returned.

### getSummary

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getSummary(res: Resources!): CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Return the currently set summary. If `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#summaryRes:kotlin.Int` is set, this resource is loaded from res and returned. Otherwise `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#summary:kotlin.CharSequence` is returned.

### getTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getTitle(res: Resources!): CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Return the currently set title. If `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#titleRes:kotlin.Int` is set, this resource is loaded from res and returned. Otherwise `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity.Header#title:kotlin.CharSequence` is returned.

### readFromParcel

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun readFromParcel(in: Parcel!): Unit
```

**Deprecated:** *Deprecated in Java.*

### writeToParcel

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

**Deprecated:** *Deprecated in Java.*

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): The Parcel in which the object should be written. This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val CREATOR: Parcelable.Creator<PreferenceActivity.Header!>
```

**Deprecated:** *Deprecated in Java.*

### breadCrumbShortTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var breadCrumbShortTitle: CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Optional text to show as the short title in the bread crumb.

### breadCrumbShortTitleRes

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var breadCrumbShortTitleRes: Int
```

**Deprecated:** *Deprecated in Java.*

Resource ID of optional text to show as the short title in the bread crumb.

### breadCrumbTitle

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var breadCrumbTitle: CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Optional text to show as the title in the bread crumb.

### breadCrumbTitleRes

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var breadCrumbTitleRes: Int
```

**Deprecated:** *Deprecated in Java.*

Resource ID of optional text to show as the title in the bread crumb.

### extras

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var extras: Bundle!
```

**Deprecated:** *Deprecated in Java.*

Optional additional data for use by subclasses of PreferenceActivity.

### fragment

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var fragment: String!
```

**Deprecated:** *Deprecated in Java.*

Full class name of the fragment to display when this header is selected.

### fragmentArguments

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var fragmentArguments: Bundle!
```

**Deprecated:** *Deprecated in Java.*

Optional arguments to supply to the fragment when it is instantiated.

### iconRes

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var iconRes: Int
```

**Deprecated:** *Deprecated in Java.*

Optional icon resource to show for this header.

### id

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var id: Long
```

**Deprecated:** *Deprecated in Java.*

Identifier for this header, to correlate with a new list when it is updated. The default value is `https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity#HEADER_ID_UNDEFINED:kotlin.Long`, meaning no id.

### intent

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var intent: Intent!
```

**Deprecated:** *Deprecated in Java.*

Intent to launch when the preference is selected.

### summary

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var summary: CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Optional summary describing what this header controls.

### summaryRes

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var summaryRes: Int
```

**Deprecated:** *Deprecated in Java.*

Resource ID of optional summary describing what this header controls.

### title

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var title: CharSequence!
```

**Deprecated:** *Deprecated in Java.*

Title of the header that is shown to the user.

### titleRes

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var titleRes: Int
```

**Deprecated:** *Deprecated in Java.*

Resource ID of title of the header that is shown to the user.