Android ListView Example

In this example, I am going to show how to create a ListView in android. To create lists you have to add ListView in your xml layout and create a new layout and add TextView.

Android Material Design with Design Support Library
Android WebView Tutorial with Example
How to Share Android Studio Project on GitHub

Create a new Android Project

Application Name: Android ListView Example
Company Domain: viralandroid.com
Package Name: com.viralandroid.androidlistviewexample
Minimum SDK: Android 2.2 (API 8 Froyo)

XML Main Layout File

In your main layout add ListView which looks like this.

XML ListView Row Layout File

Following is the xml code of listview_row.xml file.

Java Activity File

Following is the modified java code of MainActivity.java file.

Strings.xml File


Now, run your application which looks like this.

Android ListView Example
Android ListView

Download Complete Example Project

Download complete Android ListView Example project source code from GitHub.

UI 2147781585052087624
Home item