Tuesday, November 20, 2012

Error parsing XML: unbound prefix - Android



If you get an error "Error parsing XML: unbound prefix" in your XML file, then you should add the following code in your first node,

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

like the following,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

</LinearLayout>



No comments:

Post a Comment