OnSelectedDelegate


@CarProtocol
public interface OnSelectedDelegate


A host-side delegate for sending androidx.car.app.model.ItemList.OnSelectedListener events to the car app.

Summary

Public methods

abstract void
sendSelected(int selectedIndex, @NonNull OnDoneCallback callback)

Notifies that an item was selected.

Public methods

sendSelected

Added in 1.0.0
abstract void sendSelected(int selectedIndex, @NonNull OnDoneCallback callback)

Notifies that an item was selected.

This event is called even if the selection did not change, for example, if the user selected an already selected item.

Parameters
int selectedIndex

the index of the selected item

@NonNull OnDoneCallback callback

the OnDoneCallback to trigger when the client finishes handling the event