Skip to content Skip to sidebar Skip to footer

Android Mapview V2 Black Screen

I've been trying to implement v2 of android's MapView. I got it working just fine with the exception to this bug. This is what it looks like when I load the app from scratch... A

Solution 1:

I Disable hardware acceleration at file manifest.xml, and my application doesnt show black map again in second load. i try it in emulator.

<application android:hardwareAccelerated="false">
 ...
</application

from this article: http://developer.android.com/guide/topics/graphics/hardware-accel.html

Solution 2:

A bit late but,I found out that WebViews (even on other fragments) sometime "crash" the GL engine or something which results in black screens in the MapView. I found in LogCat this:

09-3010:58:17.765: E/libEGL(29805): callto OpenGL ES API with no current context (logged once per thread)
09-3010:58:17.765: W/Adreno200-EGL(29805): <qeglDrvAPI_eglSwapBuffers:3421>: EGL_BAD_CONTEXT
09-3010:58:17.765: W/HardwareRenderer(29805): EGL error: EGL_BAD_CONTEXT
09-3010:58:17.775: W/HardwareRenderer(29805): Mountain View, we've had a problem here.

Switching back to software rendering. To fix this when the WebView is detached I call the destroy function, in a Fragment so:

@OverridepublicvoidonDestroyView() {
    if (webView != null) {
        webView.destroy();
        webView = null;
    }
    super.onDestroyView();
}

Maybe it'll give you a direction on solving this issue as well.

Post a Comment for "Android Mapview V2 Black Screen"