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

*** ** * ** ***


```
class GuidedActionDiffCallback : DiffCallback<GuidedAction!>
```

<br />

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

*** ** * ** ***

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

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedActionDiffCallback#areContentsTheSame(androidx.leanback.widget.GuidedAction,androidx.leanback.widget.GuidedAction)(oldItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction, newItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction)` Called to decide whether two items have the same data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedActionDiffCallback#areItemsTheSame(androidx.leanback.widget.GuidedAction,androidx.leanback.widget.GuidedAction)(oldItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction, newItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction)` Called to decide whether two objects represent the same item. |
| `java-static https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedActionDiffCallback` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedActionDiffCallback#getInstance()()` Returns the singleton GuidedActionDiffCallback. |

### Inherited functions

From [androidx.leanback.widget.DiffCallback](https://developer.android.com/reference/kotlin/androidx/leanback/widget/DiffCallback) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/DiffCallback#getChangePayload(Value,Value)(oldItem: Value, newItem: Value)`

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

## Public constructors

### GuidedActionDiffCallback

Added in 1.1.0

```
GuidedActionDiffCallback()
```

## Public functions

### areContentsTheSame

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

```
fun areContentsTheSame(oldItem: GuidedAction, newItem: GuidedAction): Boolean
```

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 |
|---|---|
| `oldItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | The item in the old list. |
| `newItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | The item in the new list. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the contents of the items are the same or false if they are different. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun areItemsTheSame(oldItem: GuidedAction, newItem: GuidedAction): Boolean
```

Called to decide whether two objects represent the same item.

| Parameters |
|---|---|
| `oldItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | The item in the old list. |
| `newItem: https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedAction` | The item in the new list. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the two items represent the same object or false if they are different. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
java-static fun getInstance(): GuidedActionDiffCallback
```

Returns the singleton GuidedActionDiffCallback.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/GuidedActionDiffCallback` | The singleton GuidedActionDiffCallback. |