# RemoteViews.RemoteCollectionItems

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RemoteCollectionItems

*** ** * ** ***

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

```
class RemoteCollectionItems : Parcelable
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                       ||
| ↳ | [android.widget.RemoteViews.RemoteCollectionItems](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#) |

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

## Summary

|                                                                                                                              Nested classes                                                                                                                              ||
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems.Builder) Builder class for[RemoteCollectionItems](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#)objects. |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                                   ||
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)               | [describeContents](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#describeContents())`()` <br />                                                                                                                                                                                                                                        |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)               | [getItemCount](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#getItemCount())`()` Returns the number of elements in the collection.                                                                                                                                                                                                     |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)             | [getItemId](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#getItemId(kotlin.Int))`(`position:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the id for`position`.                                                                                                                             |
| [RemoteViews](https://developer.android.com/reference/kotlin/android/widget/RemoteViews) | [getItemView](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#getItemView(kotlin.Int))`(`position:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the[RemoteViews](https://developer.android.com/reference/kotlin/android/widget/RemoteViews)to display at`position`.                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)               | [getViewTypeCount](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#getViewTypeCount())`()` Returns the view type count for the collection when used in an adapter                                                                                                                                                                        |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)       | [hasStableIds](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#hasStableIds())`()` Indicates whether the item ids are stable across changes to the underlying data.                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [writeToParcel](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Flatten this object in to a Parcel. |

|                                                                                                                                                                                                    Properties                                                                                                                                                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[RemoteViews.RemoteCollectionItems](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteCollectionItems#CREATOR:android.os.Parcelable.Creator) <br /> |

## Public methods

### describeContents

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### getItemCount

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getItemCount(): Int
```

Returns the number of elements in the collection.

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

### getItemId

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

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

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

### getItemView

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

Returns the[RemoteViews](https://developer.android.com/reference/kotlin/android/widget/RemoteViews)to display at`position`.

|                                                                       Return                                                                        ||
|------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [RemoteViews](https://developer.android.com/reference/kotlin/android/widget/RemoteViews) | RemoteViews for the position. This value cannot be`null`. |

### getViewTypeCount

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getViewTypeCount(): Int
```

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

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

**See Also**

- [android.widget.Adapter#getViewTypeCount()](https://developer.android.com/reference/kotlin/android/widget/Adapter#getViewTypeCount())  

### hasStableIds

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

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

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

**See Also**

- [android.widget.Adapter#hasStableIds()](https://developer.android.com/reference/kotlin/android/widget/Adapter#hasStableIds())  

### writeToParcel

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#):This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CREATOR: Parcelable.Creator<RemoteViews.RemoteCollectionItems!>
```