# RemoteViewsCompat.RemoteCollectionItems

Artifact: [androidx.core:core-remoteviews](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/RemoteViewsCompat.kt+class:androidx.core.widget.RemoteViewsCompat.RemoteCollectionItems) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
public final class RemoteViewsCompat.RemoteCollectionItems
```

<br />

*** ** * ** ***

Representation of a fixed list of items to be displayed in a RemoteViews collection.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems.Builder` Builder class for `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems` objects. |

| ### Public methods |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemCount()()` Returns the number of elements in the collection. |
| `final long` | `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemId(kotlin.Int)(int position)` Returns the id for `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemId(kotlin.Int)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/RemoteViews.html` | `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemView(kotlin.Int)(int position)` Returns the `https://developer.android.com/reference/android/widget/RemoteViews.html` to display at `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemView(kotlin.Int)`. |
| `final int` | `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getViewTypeCount()()` Returns the view type count for the collection when used in an adapter |
| `final boolean` | `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#hasStableIds()()` Indicates whether the item ids are stable across changes to the underlying data. |

## Public methods

### getItemCount

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

```
public final int getItemCount()
```

Returns the number of elements in the collection.

| Returns |
|---|---|
| `int` | Count of items. |

### getItemId

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

```
public final long getItemId(int position)
```

Returns the id for `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemId(kotlin.Int)`. See `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#hasStableIds()` for whether this id should be considered meaningful across collection updates.

| Returns |
|---|---|
| `long` | Id for the position. |

### getItemView

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

```
public final @NonNull RemoteViews getItemView(int position)
```

Returns the `https://developer.android.com/reference/android/widget/RemoteViews.html` to display at `https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemView(kotlin.Int)`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/RemoteViews.html` | RemoteViews for the position. |

### getViewTypeCount

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

```
public final int getViewTypeCount()
```

Returns the view type count for the collection when used in an adapter

| Returns |
|---|---|
| `int` | Count of view types for the collection when used in an adapter. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/Adapter.html#getViewTypeCount()` |   |

### hasStableIds

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

```
public final boolean hasStableIds()
```

Indicates whether the item ids are stable across changes to the underlying data.

| Returns |
|---|---|
| `boolean` | True if the same id always refers to the same object. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/Adapter.html#hasStableIds()` |   |