car/src/main/java/androidx/car/app/CarListDialog.java
private TextListItem createItem(String text, int position) {
        TextListItem item = new TextListItem(getContext());
        item.setTitle(text);

        // Save the position to pass to onItemClick().
        item.setOnClickListener(v -> onItemClick(position));

        return item;
    }
/**
     * Creates the {@link TextListItem} that represents an item in the {@code CarListDialog}.
     *
     * @param text The text to display as the title in {@code TextListItem}.
     * @param position The position of the item in the list.
     */
Creates the  TextListItem that represents an item in the  CarListDialog.
@param text The text to display as the title in  TextListItem.
@param position The position of the item in the list.
Creates the TextListItem that represents an item in the CarListDialog . @param text The text to display as the title in TextListItem . @param position The position of the item in the list .
private TextListItem createItem(String text, int position) {
        TextListItem item = new TextListItem(getContext());
        item.setTitle(text);
        item.setOnClickListener(v -> onItemClick(position));
        return item;
    }
private TextListItem createItem ( String text , int position ) { TextListItem item = new TextListItem ( getContext ( ) ) ; item . setTitle ( text ) ; item . setOnClickListener ( v -> onItemClick ( position ) ) ; return item ; }
Creates the {@link TextListItem} that represents an item in the {@code CarListDialog}.
Creates the { @link TextListItem } that represents an item in the { @code CarListDialog } .
// Save the position to pass to onItemClick().