Hi Rick.
You're right, i didn't document WebViewExtras and create any examples.
I was pushed for time when i created that library so basically just uploaded it with minimal information.
Anyway it looks as though the
callUIThread parameter is where you are having problems.
Do you understand the concept of a java
Thread?
The JavascriptInterface runs in it's own Thread, it's code executes in a different context to your B4A code.
Your B4A code runs in what is known as the user interface (UI) Thread.
Your B4A user interface can only be modified by code that executes in the UI thread.
JSInterface didn't take any account of this and if javascript used the CallSub method and that CallSub tried to modify the B4A user interface an exception would occur.
So with WebViewExtras i added the
callUIThread parameter to the CallSub method.
Think of it this way - does your javascript CallSub cause the B4A user interface to be modified?
If so then you must set callUIThread to true, otherwise set callUIThread to false.
That's the theory, here's the solution (assuming that your B4A Sub HTMLsub does modify the user interface):
Javascript = "B4A.CallSub('HTMLsub', true, document.documentElement.outerHTML)"
Martin.