i am developing one android application, in which , i need to open the url on the default browser.But i don't want to show the browser's address bar.How to solve the problem? Thanks for any help.
Asked
Active
Viewed 4,354 times
4
-
2Try this [Removing address bar from browser (to view on Android)](http://stackoverflow.com/questions/4068559/removing-address-bar-from-browser-to-view-on-android). If it doesn't, why not use a WebView in your own app? Much simpler that way. – Siddharth Lele Jul 23 '13 at 05:25
-
You can use WebViewClient for the WebView. – Paresh Mayani Jul 23 '13 at 05:25
-
I think you are looking for web page inside your application so just try my answer. – Manish Srivastava Jul 23 '13 at 05:27
1 Answers
5
public class WebViewDemoActivity extends Activity {
WebView webView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webView = (WebView) findViewById(R.id.yourwebview);
// force web view to open inside application
webView.setWebViewClient(new MyWebViewClient());
openURL();
}
private void openURL() {
webView.loadUrl("http://google.co.in");
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
Manish Srivastava
- 1,810
- 2
- 15
- 23
-
Thanks for your answer.Your answer solved my problem.i will accept your answer. – joe Jul 23 '13 at 05:36
-
-
-