Define your own ListView row item layout

Here is a simple ListView row item with a TextView.

1. Create a new xml filed named myrowitem.xml in the res\layout directory.

2. Open the myrowitem.xml and add the following line of code.

<?xml version="1.0" encoding="utf-8"?>

3. Add a TextView after the beginning tags above.

4. Add the below line immediately after the <TextView tag.

 xmlns:android="http://schemas.android.com/apk/res/android"

5. Compile and run!

Resources: