I have a webview with added javascript interface which works perfectly on most devices, except for those running Android 4.2.1.
I removed most of the code, and staye
You have to annotate (@JavascriptInterface) methods in Java class that you want to make available to JavaScript.
public class JavaScriptInterface {
Context context;
JavaScriptInterface(Context c) {
context = c;
}
@JavascriptInterface
public void edit(String postid) {
Log.d("myApp", "EDIT!");
//do stuff
} }
Its worked for me. Try out this.