title: JavascriptInterface for Webview on Android Jelly Bean and above
body: <p>I used to have a javascript interface on my mobile app that allows me to capture data from my webview back to the app, which used to work ,but recently when I upgraded the app to handle lollipop it started having issues regarding the javascriptInterface.</p>
  
  <p>This is my current code for the javascriptInterface:</p>
  
  <pre><code>webView = (WebView)findViewById(R.id.webView);
  webView.getSettings().setLoadWithOverviewMode(true);
  webView.getSettings().setUseWideViewPort(true);
  webView.setWebChromeClient(new WebChromeClient());
  webView.setWebViewClient(new MyBrowser());
  webView.getSettings().setBuiltInZoomControls(false);
  webView.addJavascriptInterface(new WebAppInterface(this), "Android");
  webView.getSettings().setJavaScriptEnabled(true);
  webView.setHorizontalScrollBarEnabled(false);
  
  @JavascriptInterface
  public boolean doSomething(String employeeID){
  
      RunSearch(employeeID);
      Log.d("runsearch", "running search");
      return true;
  }
  public class WebAppInterface {
  
      Context mContext;
  
      WebAppInterface(Context c) {
          mContext = c;
      }
  }
  </code></pre>
  
  <p>My webpage is stored locally</p>
  
  <p>The error says that :</p>
  
  <blockquote>
    <p>None of the methods in the added interface have been annotated with
    @android.webkit.JavascriptInterface; they will not be visible in API
    17</p>
  </blockquote>
  
  <p>I've looked into the documentation but What should I do to make it work with Jelly Bean and higher?</p>