title: JavascriptInterface Method for WebView not called
body: <p>I have a very weird problem, my application is an e-reader. to call functions for the web view I use a JavaScript class: </p>
  
  <pre><code>    public class MyJavaScriptInterface {
          Context mContext;
  
          /* Instantiate the interface and set the context */
          MyJavaScriptInterface(Context c) {
               mContext = c;
          }
  
          @JavascriptInterface
          public void functionToCall(String input) {
               System.out.println("this function was called: "+ input);
          }
    }
  </code></pre>
  
  <p>I have a customized web view where I add my JavaScript class.</p>
  
  <pre><code>  public class newBTWebView extends WebView implements {
         public newBTWebView(Context context) {
           super(context);
           init(context);
  
         }
         public void init(Context context) {
           System.out.println("newBTWebview init");
           this.context = context;
           this.getSettings().setJavaScriptEnabled(true);
           setInitialScale(100);
           addJavascriptInterface(new MyJavaScriptInterface(this.context), "HTMLOUT");
       }
   }
  </code></pre>
  
  <p>and in my main activity I initiate the web view and call the function using JavaScript:</p>
  
  <pre><code>   public class BookReader extends Activity implements WebViewDelegate{
          private static Context mContext;
          private static newBTWebView testWV;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          System.out.println("onCreate");
          this.requestWindowFeature(Window.FEATURE_NO_TITLE);
          super.onCreate(savedInstanceState);
          testWV = (newBTWebView) findViewById(R.id.mywebview1);
          testWV.setDelegate(this);
          testWV.setWebChromeClient(new WebChromeClient());
          testWV.getSettings().setJavaScriptEnabled(true);
          testWV.getSettings().setPluginState(PluginState.ON);
  
  
          testWV.setWebViewClient(new WebViewClient() {
  
               @Override 
               public boolean shouldOverrideUrlLoading(WebView view, String url)
               {
                   System.out.println("shouldOverrideUrlLoading: " + url);
               }
               @Override
               public void onPageFinished(WebView view, String url) {
                   System.out.println("onPageFinished");
               }
           }
      }
      public void callMyFunction
      {
           System.out.println("callMyFunction");
          testWV.loadUrl("javascript:window.HTMLOUT.functionToCall('myinput');”);
      }
   }
  </code></pre>
  
  <p>The functionToCall was working perfectly, lately in my latest update, as I was testing the application on the device it was still working, but when I submit it on store the functionToCall was not getting called any more. I tested the apk file on the device the functionToCall is not getting called. It only works when I run the app directly from the pc to the device, but using the apk file on the same device as mentioned before the functionToCall doesn't get called. </p>
  
  <p>I have tested on Samsung S4, Samsung Note 10.1, and nexus note. with android 4.4.2, 4.0.4 and 5.0.1.</p>