# GuidedActionDiffCallback

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

*** ** * ** ***


```
public class GuidedActionDiffCallback extends DiffCallback<GuidedAction>
```

<br />

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

*** ** * ** ***

DiffCallback used for GuidedActions, see `https://developer.android.com/reference/androidx/leanback/app/GuidedStepSupportFragment#setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>)`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback#GuidedActionDiffCallback()()` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback#areContentsTheSame(androidx.leanback.widget.GuidedAction,androidx.leanback.widget.GuidedAction)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction oldItem, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction newItem )` Called to decide whether two items have the same data. |
| `boolean` | `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback#areItemsTheSame(androidx.leanback.widget.GuidedAction,androidx.leanback.widget.GuidedAction)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction oldItem, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction newItem )` Called to decide whether two objects represent the same item. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback` | `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback#getInstance()()` Returns the singleton GuidedActionDiffCallback. |

### Inherited methods

From [androidx.leanback.widget.DiffCallback](https://developer.android.com/reference/androidx/leanback/widget/DiffCallback) `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/leanback/widget/DiffCallback#getChangePayload(Value,Value)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html Value oldItem, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html Value newItem)`

Called to get a change payload between an old and new version of an item.

## Public constructors

### GuidedActionDiffCallback

Added in 1.1.0

```
public GuidedActionDiffCallback()
```

## Public methods

### areContentsTheSame

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

```
public boolean areContentsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)
```

Called to decide whether two items have the same data. This information is used to detect if the contents of an item have changed.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction oldItem` | The item in the old list. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction newItem` | The item in the new list. |

| Returns |
|---|---|
| `boolean` | True if the contents of the items are the same or false if they are different. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.Callback#areContentsTheSame(int,int)` |   |

### areItemsTheSame

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

```
public boolean areItemsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)
```

Called to decide whether two objects represent the same item.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction oldItem` | The item in the old list. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedAction newItem` | The item in the new list. |

| Returns |
|---|---|
| `boolean` | True if the two items represent the same object or false if they are different. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.Callback#areItemsTheSame(int,int)` |   |

### getInstance

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

```
public static @NonNull GuidedActionDiffCallback getInstance()
```

Returns the singleton GuidedActionDiffCallback.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/widget/GuidedActionDiffCallback` | The singleton GuidedActionDiffCallback. |