How to Add a ListView to XML

ListView was added in API Level 1

1. Create an Android project if you don't already have one.

2. Open your layout/main.xml file. Add this section of code between the <LinearLayout ....> and the ending </LinearLayout> tags.

<ListView
android:layout_height="match_parent"
android:layout_width="match_parent">
</ListView>

3. Compile and run!

Next Recommended Article: android:id - Name a ListView