Android : webview cant be refresh using anyway

on Tuesday, July 8, 2014


i have web view and i try to give the user button to refresh but i cant set that button i try to use this code


the refresher button



imgbtr2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
ImageButton imgbtr2 = (ImageButton) findViewById(R.id.imageButtonr2);

WebView webView = (WebView)findViewById(R.id.webView);
webView.loadUrl("javascript:window.location.reload(true)"); // TODO Auto-generated method stub

}
});


the webview



webView = (WebView) findViewById(R.id.webView1);


webView.loadUrl("http://m.facebook.com/");
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);


but it seems like javascript:window.location.reload(true) its not work . if i use webView.loadUrl("www.exapml.com"); it will work but this is not last Url u was there not reopen the webpage from the first url


and why webview can not open page like https://vine.co/ is it coz its not end with .com .. and how to make it open all the website .. and when u enter website like Myspace and try to login using Facebook everything will work ok until u finish login it will not show anything after u connect it to ur facebook ,, is it coz of the redirection and if it is how to fix it


this is the last 3 thing's stop me from finishing my app . i hope someone can help


0 comments:

Post a Comment