In this article I will show you how to show data in ListView. There are many methods to show a data in ListView .
Before moving further, please refer to the article series on Android:
Introduction: In this article I will show you how to show data in ListView. There are many methods to show a data in ListView, but I have made custom adapter because in this adapter you can easily customize the rows.
Step 1:
Design Step 2: What is ListRow
Step 3: Go to the ProductListActivity.class and paste the following code,
What is ArrayAdapter?
Default Vs Custom Adapter Default Adapter:
Custom Adapter:
Create a custom adapter class ProductAdapter.java, Now as we can see in this image we declared two methods: one method is to make object of arraylist of product and another we declare two textview and assign it into datasource. What is LayoutInflater
Read more articles on Android:
Pro WPF: Windows Presentation Foundation in .NET 3.0