I´m actually using a WebView in my Application and it works pretty good. Now I´d like to be able to change the actual URL, just like that Addressbar in the Android Stock browser, where you can see the URL and where you simply can change it.
How can I enable this bar? Or do I have to implement it myself?! Thanks!
My Code looks like:
private void setupWebView() {
webview = new WebView(this);
webview.setWebViewClient(new MyWebViewClient());
WebSettings webSettings = webview.getSettings();
webSettings.setUserAgentString("foo");
webSettings.setJavaScriptEnabled(true);
webSettings.setAppCacheEnabled(false);
webSettings.setBuiltInZoomControls(true);
webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
MyActivity.this.setProgress(progress * 100);
}
});
}
Impossible:
The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.
http://developer.android.com/guide/webapps/webview.html
If you want to change URL by code:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With