package com.hfad.starbuzz; import android.app.ListActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; public class DrinkCategoryActivity extends ListActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Array of strings that will be adapted to this ListActivity's // ListView: String[] coffees = new String[]{ "Sucrose enhanced", "Fat and lactose enhanced", "The works", "The right way" }; // Make an Adapter for string arrays: ArrayAdapter listAdapter = new ArrayAdapter( this, android.R.layout.simple_list_item_1, coffees ); // Attach the Adapter to the ListView used by this ListActivity: ListView listDrinks = getListView(); // i.e., this.getListView(); listDrinks.setAdapter(listAdapter); } }