i use this code
every thing work fine in debug mode ,in release mode i get this error
any idea how to solve this error ,Thank you
B4X:
Private Wve As WebViewExtras
Private MyWeb As WebView
Wve.addJavascriptInterface(MyWeb, "B4A")
Wve.addWebChromeClient(MyWeb,"")
Sub MyWeb_PageFinished (Url As String)
Dim Javascript As String
Javascript="B4A.CallSub('Process_HTML', false, document.documentElement.outerHTML)"
Wve.executeJavascript(MyWeb, Javascript)
End Sub
B4X:
(CalledFromWrongThreadException) android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
texttrnaslate_process_html (java line: 841)
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6823)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:975)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5125)
at android.view.View.invalidateInternal(View.java:12774)
at android.view.View.invalidate(View.java:12710)
at android.widget.TextView.invalidateRegion(TextView.java:5405)
at android.widget.TextView.invalidateCursor(TextView.java:5348)
at android.widget.TextView.spanChange(TextView.java:8351)
at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:10557)
at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:1053)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:759)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:658)
at android.text.Selection.setSelection(Selection.java:76)
at android.text.Selection.setSelection(Selection.java:87)
at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:336)
at android.widget.TextView.setText(TextView.java:4555)
at android.widget.TextView.setText(TextView.java:4424)
at android.widget.EditText.setText(EditText.java:84)
at android.widget.TextView.setText(TextView.java:4379)
at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:43)
at anywheresoftware.b4a.objects.EditTextWrapper.setText(EditTextWrapper.java:214)
at dic.test.texttrnaslate._process_html(texttrnaslate.java:841)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at uk.co.martinpearman.b4a.webviewextras.WebViewExtras$1B4AJavascriptInterface.CallSub(WebViewExtras.java:73)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Last edited: