# GuidedAction.Builder

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/GuidedAction.java+class:androidx.leanback.widget.GuidedAction.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
class GuidedAction.Builder : GuidedAction.BuilderBase<GuidedAction.Builder!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.leanback.widget.GuidedAction.BuilderBase](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase)\<[GuidedAction.Builder](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder)!\> ||
|   | ↳ | [androidx.leanback.widget.GuidedAction.Builder](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder) |

*** ** * ** ***

Builds a `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` object.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#Builder())()` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#Builder(android.content.Context)`. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#Builder(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html?)` Creates a Builder for GuidedAction. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#build()()` Builds the GuidedAction corresponding to this Builder. |

### Inherited functions

From [androidx.leanback.widget.GuidedAction.BuilderBase](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#applyValues(androidx.leanback.widget.GuidedAction)(action: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction)`

Subclass of BuilderBase should call this function to apply values.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#autoSaveRestoreEnabled(boolean)(autoSaveRestoreEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Explicitly sets auto restore feature on the GuidedAction.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#autofillHints(java.lang.String...)(hints: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?)`

Sets autofill hints.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#checkSetId(int)(checkSetId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Indicates whether this action is part of a single-select group similar to radio buttons or this action is a checkbox.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#checked(boolean)(checked: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action is initially checked.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#clickAction(long)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Construct a clickable action with associated id and auto assign pre-defined title for the action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#description(java.lang.CharSequence)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets the description for this action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#description(int)(descriptionResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the description for this action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionEditInputType(int)(inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action description in editing.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionEditable(boolean)(editable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action's description is editable
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionInputType(int)(inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action description not in editing.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editDescription(java.lang.CharSequence)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets the optional description text to edit.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editDescription(int)(descriptionResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the optional description text to edit.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editInputType(int)(inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action title in editing.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editTitle(java.lang.CharSequence)(editTitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets the optional title text to edit.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editTitle(int)(editTitleResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the optional title text to edit.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#editable(boolean)(editable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action title is editable.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#enabled(boolean)(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action is enabled.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#focusable(boolean)(focusable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action can take focus.
`https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#getContext()()`

Returns Context of this Builder.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#hasEditableActivatorView(boolean)(editable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action has a view can be activated to edit, e.g. a DatePicker.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#hasNext(boolean)(hasNext: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action has a next state and should display a chevron.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#icon(android.graphics.drawable.Drawable)(icon: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?)`

Sets the action's icon drawable.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#icon(int)(iconResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the action's icon drawable by retrieving it by resource ID from Builder's context.
`B!` `[iconResourceId](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#iconResourceId(int,android.content.Context))(iconResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, context: https://developer.android.com/reference/android/content/Context.html!)`

**This function is deprecated.**

Use `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#icon(int)`.

<br />

`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#id(long)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Sets the ID associated with this action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#infoOnly(boolean)(infoOnly: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether this action is for information purposes only and cannot be clicked.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#inputType(int)(inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action title not in editing.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#intent(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html?)`

Sets the intent associated with this action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#multilineDescription(boolean)(multilineDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Indicates whether the title and description are long, and should be displayed appropriately.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#subActions(java.util.List<androidx.leanback.widget.GuidedAction>)(subActions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction!>?)`

Sets sub actions list.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#title(java.lang.CharSequence)(title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets the title for this action.
`B!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.BuilderBase#title(int)(titleResourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the title for this action.

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
[Builder](https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#Builder())()
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction.Builder#Builder(android.content.Context)`.

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
Builder(context: Context?)
```

Creates a Builder for GuidedAction.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html?` | Context to build GuidedAction. |

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
fun build(): GuidedAction
```

Builds the GuidedAction corresponding to this Builder.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | The GuidedAction as configured through this Builder. |