A few days ago, I began working on my first Android game. I opted to use OpenGL ES 2.0 since it was the most familiar alternative. However, I am currently unable to test the game on a real device, so I decided to use AVD instead, using a 4.0.3 virtual device with Intel HAXM installed. This seemed to work perfectly, but I have now encountered a really strange problem.
When compiling and running the game from Eclipse, it works just fine. However, if I then run the game a second time, either through the AVD or from Eclipse, nothing is drawn except the background color. If I change anything in the code so that Eclipse must recompile the application, everything once again works as it should, but only during the first run.
I have no idea what’s going on. If I had to guess I would say that the AVD is acting up somehow, but does anyone know a way to fix this? If requested, I will provide relevant source code, but as I have no idea what could cause this kind of problem, I cannot provide any right now.
It seems like the textures were being deleted when the application was paused, which led to it not drawing anything on the screen. Reloading the textures in the
onResumefunction fixed the issue.