-1

I am getting this error while creating my .xml file for customdialog in android app.

Unexpected namespace prefix "xmlns" found for tag Linear Layout

Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
android:layout_gravity="center" 
android:orientation="vertical" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"

xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView 
    ...
<ScrollView 
    ...
<LinearLayout 
    ...

  **xmlns:android="http://schemas.android.com/apk/res/android">**
    <Button 
        ...
    <Button 
        ...
    <Button 
        ...
  </LinearLayout>
</LinearLayout>
halfer
  • 19,824
  • 17
  • 99
  • 186
Mojo Jojo
  • 173
  • 2
  • 11
  • have you tried removing **xmlns:android="http://schemas.android.com/apk/res/android">** you already gave it in the start – insomniac Jan 25 '14 at 09:42

2 Answers2

1

Just remove the line you have already marked with stars:

**xmlns:android="http://schemas.android.com/apk/res/android">**

(Well, you'll have to keep the >)

The xmlns tag should only be included in the outmost container.

FD_
  • 12,947
  • 4
  • 35
  • 62
0

At that point in the XML, you're already in the scope of the first xmlns:android definition. You shouldn't be defining it again. Just delete that second definition and you'll be fine.

Dawood ibn Kareem
  • 77,785
  • 15
  • 98
  • 110