How to remove address bar coming to webview

10,063

Solution 1

There is no address bar in a WebView. Question has already been stated here: Disable address bar in Android webview

What you probably wants is to remove the title. If I remember correctly the name/url is also stated in the title of the activity. You should read: http://developer.android.com/resources/tutorials/views/hello-webview.html

You could remove the title by writing this for your activity in your manifest file.

<activity android:name=".MyActivity" android:label="@string/app_name"
 android:theme="@android:style/Theme.NoTitleBar">

Solution 2

2015 For Android Studio 1.0

Edit your manifest so theme looks like:

android:theme="@style/AppTheme.NoTitleBar"

Then open src/main/res/values/styles.xml and add the following:

    <style name="AppTheme.NoTitleBar" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
</style>

And gone is the whatchamacallit bar

Share:
10,063
Vivek Tamrakar
Author by

Vivek Tamrakar

Updated on June 04, 2022

Comments

  • Vivek Tamrakar
    Vivek Tamrakar almost 2 years

    I hava a webview showing some contents which is getting from server. Now on that same activity i use to override differnt urls based on condition. Means my webview is one and is loading differnt differnt page depending on the condition. Now in this webview bydefault I am getting address bar. Can anyone help me how to avoid addressbar coming to a webview.