I am trying to open a twitter link: http://mobile.twitter.com/pawan_rathore88
in my activity. If I install WebViewClient in webview, I get a blank page. But when I download the URL without installing any web client, it loads the page correctly. Does anyone know what could be the problem. Below is a snippet of code.
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.v(tag, "url :" + url);
view.loadUrl(url);
return true;
}
});
webview.loadUrl("http://mobile.twitter.com/pawan_rathore88");
Thanks Pavan
source
share