public class MainActivity extends Activity {
private static WebView mWebView;
etc...
// JS -> ANDROID
public class WebAppInterface {
Context mContext;
WebAppInterface(Context c) {
mContext = c;
}
@JavascriptInterface
public void fn1() {
mWebView.loadUrl("javascript:jsfn('testing123');");
}
}
}
I getting this error:
W/WebView: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread.