libgdx/libgdx — pull request #1557 by davebaol (2014-03-26 10:10:41+00:00)
Title: Proper support for onAttachedToWindow and onDetachedFromWindow methods on Android 2.x

This old PR of mine https://github.com/libgdx/libgdx/pull/859 explains why I need proper support for the mentioned methods on Android 2.3 and lower.
That PR has been dropped by a recent commit because only OpenGL ES 1.x was supported. So I had to add support for OpenGL ES 2.0 in order to successfully run my app with the last nightly builds on Android 2.x.

Relevant changes:
- Added GLSurfaceViewAPI18 and GLSurfaceView20API18 which are slightly modified copies of android.opengl.GLSurfaceView from Android 4.3 source code (API 18) and GLSurfaceView20 respectively.
- Added config property useGLSurfaceView20API18 (default false) which is effective only for API level <= 10, see createGLSurfaceView method.
- Updated AndroidApplication, AndroidGraphics, and AndroidFragmentApplication classes (the last-named not tested though, sorry).
- Removed some annoying warnings and fixed some javadoc typos.

Successfully tested on the following devices that are not working for me with the last nightly builds:
- Samsung Galaxy S Plus - Android 2.3.5 (API 10)
- LG Optimus Net - Android 2.3.4 (API 10)
- Samsung Galaxy SII - Android 2.3.3 (API 10)

Unfortunately I have no devices having both Android 2.2 and OpenGL ES 2.0. However, I'm confident that it works because the old PR works perfectly with Android 2.2 and OpenGL ES 1.x.

Finally, it looks like Daydream and LiveWallpaper classes have to be updated too, but I'm not sure it's worth. Let me know your thought.