# RemoteViewsCompat.RemoteCollectionItems

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems "View this page in Java")

<br />

```
class RemoteViewsCompat.RemoteCollectionItems
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                               ### Nested types                                                                                                                                                               |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[RemoteViewsCompat.RemoteCollectionItems.Builder](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems.Builder) Builder class for[RemoteCollectionItems](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems)objects. |

|                                  ### Public functions                                  |
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)          | [getItemId](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemId(kotlin.Int))`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the id for[position](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemId(kotlin.Int)).                                                                                                   |
| [RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html) | [getItemView](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemView(kotlin.Int))`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the[RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html)to display at[position](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#getItemView(kotlin.Int)). |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)    | [hasStableIds](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#hasStableIds())`()` Indicates whether the item ids are stable across changes to the underlying data.                                                                                                                                                                                                                                                                              |

|                            ### Public properties                            |
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [itemCount](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#itemCount()) Returns the number of elements in the collection.                              |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [viewTypeCount](https://developer.android.com/reference/kotlin/androidx/core/widget/RemoteViewsCompat.RemoteCollectionItems#viewTypeCount()) Returns the view type count for the collection when used in an adapter |

## Public functions

### getItemId

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

```
fun getItemId(position: Int): Long
```

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

|                                    Returns                                    |
|-------------------------------------------------------------------------------|----------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | Id for the position. |

### getItemView

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

```
fun getItemView(position: Int): RemoteViews
```

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

|                                        Returns                                         |
|----------------------------------------------------------------------------------------|-------------------------------|
| [RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html) | RemoteViews for the position. |

### hasStableIds

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

```
fun hasStableIds(): Boolean
```

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

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True if the same id always refers to the same object. |

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

## Public properties

### itemCount

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

```
val itemCount: Int
```

Returns the number of elements in the collection.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Count of items. |

### viewTypeCount

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

```
val viewTypeCount: Int
```

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

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Count of view types for the collection when used in an adapter. |

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