I am making an android app in which i have to show Hash Tag link of twitter But when i load this in our customized webview it will open in the default browser.Can you help me how to open this in the web view rather then in the default Browser?
Link is: https://mobile.twitter.com/search/%23nokia
Thanks…
WebViewClient yourWebClient = new WebViewClient()
{
/* Override page so it's load on my view only */
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
// This line we let me load only pages inside Firstdroid Webpage
if ( url.contains("firstdroid") == true )
/* Load new URL Don't override URL Link */
return false;
// Return true to override url loading (In this case do nothing).
return true;
}
};
// Get Web view
mWebView = (WebView) findViewById( R.id.WebView ); //This is the id you gave
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSupportZoom(true); //Zoom Control on web (You don't need this
//if ROM supports Multi-Touch
mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM
mWebView.setWebViewClient(yourWebClient);
// Load URL
Log.v("", ""+web2);
mWebView.loadUrl(web2);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.v("", "EXECUTED");
//website.this.finish();
Intent ii = new Intent(getParent(), Socialsites.class);
TabGroupActivity parentActivity3 = (TabGroupActivity)getParent();
// ii.putExtra("WEB", six.get(arg2));
parentActivity3.startChildActivity("bb", ii);
}
});
Write load.loadUrl(url) inside the shouldOverrideUrlLoading() as: