1. Create a list called myList.
2. Create an ArrayAdapter.
3. In MainActivity.java, add the line below to the onCreate method. This is linked to a list named myList.
myArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, myList);
4. Compile and test!
Resource:
Popular Posts
- android:ellipsize - Add an ellipsis(...) in a TextView
- Save LogCat to a Text File
- android:typeface - Set the Typeface to Sans, Serif, or Monospace in a TextView/EditText
- android:scrollbarStyle - Change the Scrollbar Location/Style in a TextView
- How to Get Current Time in Milliseconds
- Intent setType(String type) - How to Set an Explicit MIME data type
- Perform an Action after Enter keypress on EditText
- Change the line spacing between lines of text in an TextView/EditText, using lineSpacingMultiplier
- android:alpha - Set the Opacity/Transparency of Text in TextView/EditText
- Capitalize Text in a TextView, using inputType