I have an array that I pass to the CustomAdapter for the ListView. The array has elements that are already sorted. Sort of:
[{"stuff":[{"stuff_id": "1", "value":"test123"},
{"stuff_id": "1", "value":"test123"},
{"stuff_id": "2", "value":"test123"}]}]
The array changes the selection, so I don’t know how many sections I will have. So far, I have found strange results when using a device against using an emulator. For example, I register a position in the getView () method every time it is called and with an emulator, I get it only once. With a device (Motorola Droid - 2.1), every fourth row or so is at position 0. I believe this has something to do with screen size and reuse, but I'm not sure.
I tried using login like, if (position == 0) draw section header, and then if (stuff_id! = Previous_stuff_id) draw section header. But since the position returns to zero, I get header lines where I shouldn't.
Has anyone seen these types of results and know how to fix them?
source
share