Skip to content

Instantly share code, notes, and snippets.

@moondroid
Created December 11, 2012 19:37
Show Gist options
  • Save moondroid/4261389 to your computer and use it in GitHub Desktop.
Save moondroid/4261389 to your computer and use it in GitHub Desktop.
Simple ArrayAdapter
// Create the Array List of to do items
final ArrayList<String> todoItems = new ArrayList<String>();
// Create the Array Adapter to bind the array to the List View
// ArrayAdapter(Context context, int textViewResourceId, List<T> objects)
final ArrayAdapter<String> aa;
aa = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, todoItems);
// Bind the Array Adapter to the List View
myListView.setAdapter(aa);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment