# 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)

*** ** * ** ***


```
public class GuidedAction.Builder extends GuidedAction.BuilderBase<GuidedAction.Builder>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.leanback.widget.GuidedAction.BuilderBase](https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase)\<[GuidedAction.Builder](https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder)\> ||
|   | ↳ | [androidx.leanback.widget.GuidedAction.Builder](https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder) |

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder#Builder())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder#Builder(android.content.Context)`. <br /> |
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder#Builder(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html context)` Creates a Builder for GuidedAction. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction` | `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.Builder#build()()` Builds the GuidedAction corresponding to this Builder. |

### Inherited methods

From [androidx.leanback.widget.GuidedAction.BuilderBase](https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase) `final void` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#applyValues(androidx.leanback.widget.GuidedAction)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction action)`

Subclass of BuilderBase should call this function to apply values.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#autoSaveRestoreEnabled(boolean)(boolean autoSaveRestoreEnabled)`

Explicitly sets auto restore feature on the GuidedAction.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#autofillHints(java.lang.String...)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] hints)`

Sets autofill hints.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#checkSetId(int)(int checkSetId)`

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/androidx/leanback/widget/GuidedAction.BuilderBase#checked(boolean)(boolean checked)`

Indicates whether this action is initially checked.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#clickAction(long)(long id)`

Construct a clickable action with associated id and auto assign pre-defined title for the action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#description(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html description)`

Sets the description for this action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#description(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int descriptionResourceId)`

Sets the description for this action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionEditInputType(int)(int inputType)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action description in editing.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionEditable(boolean)(boolean editable)`

Indicates whether this action's description is editable
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#descriptionInputType(int)(int inputType)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action description not in editing.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editDescription(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html description)`

Sets the optional description text to edit.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editDescription(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int descriptionResourceId)`

Sets the optional description text to edit.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editInputType(int)(int inputType)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action title in editing.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editTitle(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html editTitle)`

Sets the optional title text to edit.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editTitle(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int editTitleResourceId)`

Sets the optional title text to edit.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#editable(boolean)(boolean editable)`

Indicates whether this action title is editable.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#enabled(boolean)(boolean enabled)`

Indicates whether this action is enabled.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#focusable(boolean)(boolean focusable)`

Indicates whether this action can take focus.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#getContext()()`

Returns Context of this Builder.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#hasEditableActivatorView(boolean)(boolean editable)`

Indicates whether this action has a view can be activated to edit, e.g. a DatePicker.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#hasNext(boolean)(boolean hasNext)`

Indicates whether this action has a next state and should display a chevron.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#icon(android.graphics.drawable.Drawable)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/drawable/Drawable.html icon)`

Sets the action's icon drawable.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#icon(int)(@https://developer.android.com/reference/androidx/annotation/DrawableRes int iconResourceId)`

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

**This method is deprecated.**

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

<br />

`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#id(long)(long id)`

Sets the ID associated with this action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#infoOnly(boolean)(boolean infoOnly)`

Indicates whether this action is for information purposes only and cannot be clicked.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#inputType(int)(int inputType)`

Sets `https://developer.android.com/reference/android/text/InputType.html` of this action title not in editing.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#intent(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html intent)`

Sets the intent associated with this action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#multilineDescription(boolean)(boolean multilineDescription)`

Indicates whether the title and description are long, and should be displayed appropriately.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#subActions(java.util.List<androidx.leanback.widget.GuidedAction>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/leanback/widget/GuidedAction> subActions)`

Sets sub actions list.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#title(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html title)`

Sets the title for this action.
`B` `https://developer.android.com/reference/androidx/leanback/widget/GuidedAction.BuilderBase#title(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int titleResourceId)`

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)

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

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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)

```
public Builder(@Nullable Context context)
```

Creates a Builder for GuidedAction.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html context` | Context to build GuidedAction. |

## Public methods

### build

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

```
public @NonNull GuidedAction build()
```

Builds the GuidedAction corresponding to this Builder.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction` | The GuidedAction as configured through this Builder. |