Disable address bar in Android webview
There is no address bar in a WebView
.
If you think you have a WebView
, and you see an address bar, that is not your WebView
. Rather, you are looking at the Browser application. Most likely, the URL you told the WebView
to load did a redirect, and you did not intercept that redirect using a WebViewClient
and shouldOverrideURLLoading()
.
Adding myView.setWebViewClient(new WebViewClient());
disabled the address bar for me.
import android.webkit.WebView;
import android.webkit.WebViewClient;
...
WebView myView = findViewById(R.id.myExampleView);
myView.setWebViewClient(new WebViewClient());
myView.getSettings().setJavaScriptEnabled(true);
myView.loadUrl("https://www.stackoverflow.com");
XML Snippet
<WebView android:id="@+id/myExampleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:gravity="center" />
source: (Japanese site): http://www.techdoctranslator.com/android/webapps/webview