I m coding a WebView application that should call some javascript functions everytime a page is loaded
This is what I ve done but it doesn't work.
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView view = (WebView) findViewById(R.id.webView);
WebSettings faller = view.getSettings();
String url = "http://ift.tt/1csYSzJ";
faller.setJavaScriptEnabled(true);
view.loadUrl(url);
view.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:clickFunction()");
view.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:clickFunction2()");
}
}
});
}
}
Everything goes well Untill i reach the clickfunction2(). I can't call this second function Where I m wrong??
Aucun commentaire:
Enregistrer un commentaire