Created
October 4, 2015 06:48
-
-
Save KennethanCeyer/6bb178c5b8d9748778ce to your computer and use it in GitHub Desktop.
Android ListView Add Item From Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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