user2582318 user2582318 - 2 months ago 33
Android Question

Android 6 + WebView + Rangy library = SIGSEGV Crash

Im using Webview + Rangy Class Applier Module (by Tim)

after a button click, it load a javascript

webview.loadUrl("javascript:applyColor(color1)");


and the function

function applyColor(colorCSSClass) {
applier = rangy.createClassApplier(colorCSSClass);
applier.toggleSelection();
//Remove Other css colours
}


and for some weird reason, after some applied colors the app crash and i receive this error :

W/Adreno-GSL: <gsl_ldd_control:475>: ioctl fd 36 code 0x40180917 (IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID) failed: errno 16 Device or resource busy
W/Adreno-GSL: <gsl_ldd_control:475>: ioctl fd 36 code 0x40180917 (IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID) failed: errno 16 Device or resource busy
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad: Chrome build fingerprint:
W/google-breakpad: 3.0.0.5
W/google-breakpad: 3005
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7b in tid 25790 (RenderThread)
D/HyLog: D: Wrong tag (927 : loadPreData() : frameworks/base/core/jni/android/graphics/TypefaceHyFontManager.cpp)


UPDATE: this error does not occurs in Android 5.1

Answer

FOUND THE SOLUTION, ITS A OLD PROBLEM, occurs for some people and for others not, for me was in android 6.0

The Solution:

webview.load... //load your html

than after the loading:

                webview.setBackgroundColor(Color.TRANSPARENT);
                Paint p = new Paint();
                webview.setLayerType(View.LAYER_TYPE_SOFTWARE, p);

It seems to hit a little performance when you talk about Smooth scrolling, dont know if its version related or is there any fix, if i find or someone, please, post here

no crashs anymore after this