Log in



Tags » ‘AlertDialog.Builder’

Grokking the ListAdapter, Part 1 of N

June 15th, 2012 by

Here’s my first published tip regarding Android development…

i admit it – my first 4 or 5 days with Android i simply could not understand how to use the ListView and the related Adapter classes. i kept having to add 1 or 2 levels of containers between my data and the list view, and kept thinking, “certainly this is not intended to be so painful!” Finally, after hours of reading through example after example demonstrating SimpleAdapter and friends, i came across a comment post somewhere (now lost) which demonstrated a very simple anonymous subclass of ┬áBaseAdapter (far simpler than the jumping-through-hoops demonstrated by most examples i had seen). The following demonstrates a real live function (not a contrived example) which demonstrates how to use the ListAdapter: