The method getViewTypeCount “returns the number of types of Views that will be created by getView(int, View, ViewGroup)“.
Usually when we want to customize the ListView data we use a custom adapter.
Even if the example is quite simple, it is enough to understand how to use several ListView methods to get this result. In this app, we show a Contact list that has two different layouts one that uses an image and another one without image. We want to have something like the pic shown below: By now we have seen rows having the same layout, anyway it is possible to have rows with different layouts. In this post, I will cover another aspect related to the ListView that was not covered in the past: ListView with multiple row layout. In many posts we talked extensively about ListView and how to handle it: creating custom adapter or handling user interactions.