Android ListView Example
https://www.viralandroid.com/2015/10/android-listview-example.html
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.
Related:
Android Material Design with Design Support Library
Android WebView Tutorial with Example
How to Share Android Studio Project on GitHub
Application Name: Android ListView Example
Company Domain: viralandroid.com
Package Name: com.viralandroid.androidlistviewexample
Minimum SDK: Android 2.2 (API 8 Froyo)
In your main layout add ListView which looks like this.
res/layout/activity_main.xml
Following is the xml code of listview_row.xml file.
res/layout/listview_row.xml
Following is the modified java code of MainActivity.java file.
src/MainActivity.java
res/values/strings.xml
Now, run your application which looks like this.
Related:
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.
res/layout/activity_main.xml
XML ListView Row Layout File
Following is the xml code of listview_row.xml file.
res/layout/listview_row.xml
Java Activity File
Following is the modified java code of MainActivity.java file.
src/MainActivity.java
Strings.xml File
res/values/strings.xml
Now, run your application which looks like this.
![]() |
Android ListView |