0

Here is my xml code and I'm getting a "the markup document following the root element must be well formed"

<?xml version="1.0" encoding="utf-8"?>

<TextView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/title_paired_devices"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/title_paired_devices"
    android:visibility="gone"
    android:background="#666"
    android:textColor="#fff"
    android:paddingLeft="5dp"
/>
<ListView android:id="@+id/paired_devices"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:layout_weight="1"
/>
<TextView android:id="@+id/title_new_devices"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/title_other_devices"
    android:visibility="gone"
    android:background="#666"
    android:textColor="#fff"
    android:paddingLeft="5dp"
/>
<ListView android:id="@+id/new_devices"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:layout_weight="2"
/>
<Button android:id="@+id/button_scan"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/button_scan"
/>

</menu>

It was originally a LinearLayout but following other answers to this problem, this still gives me an error

Mau
  • 13
  • 2
  • Shouldn't the document have just one element as root? I.e. all other elements must be enclosed in a single tag. Related question: http://stackoverflow.com/questions/7090577/android-app-the-markup-in-the-document-following-the-root-element-must-be-well – lucian.pantelimon Feb 01 '13 at 15:28

2 Answers2

1

You don't have an opening Menu tag as root.

Stefan de Bruijn
  • 6,289
  • 2
  • 23
  • 31
1

There's two problems, you have a closing menu tag with no opening one, and there's no layout for this to go into. Reference this: http://developer.android.com/guide/topics/ui/declaring-layout.html

Jonathon Cwik
  • 987
  • 11
  • 18