Skip to content

Instantly share code, notes, and snippets.

@KennethanCeyer
Created October 4, 2015 06:48
Show Gist options
  • Save KennethanCeyer/6bb178c5b8d9748778ce to your computer and use it in GitHub Desktop.
Save KennethanCeyer/6bb178c5b8d9748778ce to your computer and use it in GitHub Desktop.
Android ListView Add Item From Array
ListView mList = (ListView) findViewById(R.id.mainList);
String[] items = new String[] {
"Hello World!",
"Foo Bar",
"404 Not Found",
"Dev Students"
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, items);
mList.setAdapter(adapter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment