I read all the other posts on getView() and didn't find any solutions. I have a GridView with a SimpleCursorAdapter. I log(position); in getView() and I see a pattern like this:
0,0,1,0,0,2,0,0,3,0,0,4,0,0,5 etc. This means I'm having to build 3 views as it scrolls for every new view displayed and it's choppy and laggy. Why does it do this? I don't have anything obvious like setting my gridview to wrap-content or anything else weird. There's nothing strange about my code. One thing that might be a factor is that every item view could have a different height depending on the length of the text I'm displaying.
I'm currently debugging on a 4.2.2 Galaxy Nexus.
getView()
method of adapter has always been a mess. – DoradoradogetView()
on position 0 is invoked even when position 0 isn't seen at all, like when the grid is scrolled down. I guess this happens because Android wants to measure the grid. – Prayer