car/src/main/java/androidx/car/app/CarListDialog.java
private void initializeWithItems(String[] items) {
        Context context = getContext();
        List<ListItem> listItems = new ArrayList<>();

        for (int i = 0; i < items.length; i++) {
            listItems.add(createItem(/* text= */ items[i], /* position= */ i));
        }

        mAdapter = new ListItemAdapter(context, new ListItemProvider.ListProvider(listItems));

    }
/**
     * Initializes {@link #mAdapter} to display the items in the given array. It utilizes the
     * {@link TextListItem} but only populates the title field with the the values in the array.
     */
Initializes  #mAdapter to display the items in the given array. It utilizes the
TextListItem but only populates the title field with the the values in the array.
Initializes #mAdapter to display the items in the given array . It utilizes the TextListItem but only populates the title field with the the values in the array .
private void initializeWithItems(String[] items) {
        Context context = getContext();
        List<ListItem> listItems = new ArrayList<>();
        for (int i = 0; i < items.length; i++) {
            listItems.add(createItem(/* text= */ items[i], /* position= */ i));
        }
        mAdapter = new ListItemAdapter(context, new ListItemProvider.ListProvider(listItems));
    }
private void initializeWithItems ( String [ ] items ) { Context context = getContext ( ) ; List < ListItem > listItems = new ArrayList < > ( ) ; for ( int i = 0 ; i < items . length ; i ++ ) { listItems . add ( createItem ( /* text= */ items [ i ] , /* position= */ i ) ) ; } mAdapter = new ListItemAdapter ( context , new ListItemProvider . ListProvider ( listItems ) ) ; }
Initializes {@link #mAdapter} to display the items in the given array.
Initializes { @link #mAdapter } to display the items in the given array .