Android TutorialsNo Comments

1145 views.

For creating Custom listview  we need one more layout (XML file) for list item design (like Image , Text).

Already we know how to create Normal listview here also we are doing the same instead of ArrayAdapter here we design CustomAdapter.

Now inside the project we just created; open the layout file for our launcher activity i.e. activity_main.xml
Now we will create the following layout (see the image below)lis

For creating the above layout you can use the following code

We have coded the layout. Inside our layout there is only one ListView Now for our Android Custom ListView Example we have to create a new layout file. So right click on your layout folder -> go to new -> and then select file. You can name the file anything. I just created a customt.xml Copy the following code for your custom.xml file

MainActivity.Java

From here you create new CustomAdapter.java class

Output

lis1

Be the first to post a comment.

Add a comment