title: Html Button OnClick to move Another Activity in Android
body: <p>I am getting <code>None of the methods in the added interface @android.webkit.JavascriptInterface.They will not be visible in Api level 17.</code> compile error at addJavascriptInterface method.</p>
  
  <p>I have pointed out the error line in below code:</p>
  
  <p><strong>WebView code:</strong></p>
  
  <pre><code>import android.webkit.JavascriptInterface;
  
  webView = (WebView) findViewById(R.id.load_url);
  webView.getSettings().setJavaScriptEnabled(true);
  
   if (new File(url).exists()) {
              webView.loadUrl(FILENAME_PREFIX + url);
              Log.d("fileurl", "" + FILENAME_PREFIX + url);
  
          }
  
          webView.addJavascriptInterface(new Object() { ---&gt;None of the methods in the added interface @android.webkit.JavascriptInterface.They will not be visible in Api level 17.
  
              @JavascriptInterface
              public void performClick() {
                  Intent intRef=new Intent(FirstActivity.this,SecondActivity.class);
                  startActivity(intRef);
              }
          }, "ok");
  </code></pre>
  
  <p><strong>Html Code:</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
           &lt;div&gt;
              &lt;button type="button" onclick="ok.performClick();"&gt;OK&lt;/button&gt;
          &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am using  minSdkVersion 11 and targetSdkVersion 22.I had called   @JavascriptInterface in before method.You could see that in above code.</p>
  
  <p>Anyone can help me with this.Thank you.</p>