itemSelections
Create a InitialValueFlow of item selections on the AdapterView instance where the value emitted is the selected position, or AdapterView.INVALID_POSITION if nothing is selected.
Note: Created flow keeps a strong reference to the AdapterView instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
adapterView.itemSelections()
.onEach { position ->
// handle adapter view item selection
}
.launchIn(uiScope)
Content copied to clipboard