Last active
July 25, 2020 20:51
-
-
Save sryze/d629bd536222af63fe32f8387ff5a176 to your computer and use it in GitHub Desktop.
Fix WebView crash when running on Android emulator: A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid XXX (RenderThread), pid YYY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val isHardwareAccelerated = | |
window.attributes.flags and WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED != 0 | |
if (isHardwareAccelerated) { | |
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null) | |
} else { | |
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment