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
- Solution: error: Error parsing XML: unbound prefix
- android:background - Change the Background Color of an EditText
- android:requiresFadingEdge
- Cursor getColumnIndexOrThrow - Get the Index for a Column Name
- Solution: Running Android Lint has encountered a problem Failed
- android:maxWidth - Set the Maximum Width of TextView
- How to Install an SDK package
- How to Register an Activity that Responds to NFC tags for URI's that point to a URL
- Change the line spacing between lines of text in an TextView/EditText, using lineSpacingExtra
- How to Add a Toast