0

why is layout xml file rejecting WebView tag. Red circle with cross is displayed in line xmlns:android="http://schemas.android.com/apk/res/android" and application can not be started.

Thank you

1 Answers1

0

I am guessing you've put the xmlns tag in the webview, something like this:

<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/imageView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Change it to

<WebView
    android:id="@+id/imageView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

The xmlns:android tag should only be added to the outermost layout.

As to why we use xmlns:android, Read : Why this line xmlns:android="http://schemas.android.com/apk/res/android" must be the first in the layout xml file?

Community
  • 1
  • 1
Shivam Verma
  • 7,973
  • 3
  • 26
  • 34
  • 1
    Many thanks! It was working when WebView was the only tag in layout, but when I put it into LinearLayout, error appeared. Thank you so much for your quick answer! – user3599319 May 03 '14 at 15:12