Well, here's the likely starting point:
Step #1: Create an ArrayAdapter
, whose data model is your array of read-in rows
Step #2: Override getCount()
to return the array size plus 1, to accommodate your extra "Load more" row
Step #3: Override getViewTypeCount()
to return 2 (or more, if your ListView
rows for the CSV rows are not all the same -- I will assume they are all the same for the rest of this answer, so the two types are "regular row" and "'Load more' row")
Step #4: Override getItemViewType()
to return 1 when the position is equal to your array size, or 0 for everything lower than that
Step #5: Override getView()
to return the appropriate row, including returning your "Load more" row
Step #6: When the user clicks the "Load more" row, run through your logic to read in the next CSV lines, adding them to your array, then calling notifyDataSetChanged()
on the adapter to alert the ListView
that the data has changed