I've implemented a GridView based on this tutorial. It works great unless open up the search dialog or rotate the screen then scroll around.
When the search dialog and virtual keyboard appear, the drawables for each of my grid items shift. I can click on them and they do what I expect, except the drawable is wrong.
The same problem happens when I go into landscape mode and scroll around. If I scroll down, up, the down again, the drawables are shuffled.
For better illustration, let's say I have three objects, each with an image.
- Obj A shows an Apple
- Obj B shows a Banana
- Obj C shows a Cantaloupe
When the shift occurs I end up with:
- Obj A shows an Cantaloupe
- Obj B shows a Banana
- Obj C shows a Apple
The problem isn't consistent between the two causes (search dialog and screen rotate n' scroll), but each cause itself is consistent. Scrolling around repeatedly reveals a pattern as does the search dialog appearing. How can I stop this from happening?