Creating custom views

Though you can often get away with simply using the views that are provided with Android, there may also be situations, like the one we are now facing, where you need a custom view to display your own object in a unique way.

In the ReviewList screen we used an Adapter of type ReviewAdapter to back our ListView. This is a custom Adapter that contains a custom View object, ReviewListView. A ReviewListView is what our ReviewList Activity displays for every row of data it contains. The Adapter and View are shown in listing 3.5.

0 0

Post a comment