Question

I have an Error parsing XML: unbound prefix in this xml file:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/sipLabel"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"/>
    <ImageView android:src="@drawable/connected" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_weight="0.35" android:gravity="center"/>
</LinearLayout>

The error is in <ImageView>. What could be the problem?

Thank you very much.

Was it helpful?

Solution

You must put the namespace declaration xmlns:android="http://schemas.android.com/apk/res/android" in the root element of your layout xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]

OTHER TIPS

Your need to define the xmlns attribute in the topmost element, in this case, the LinearLayout tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top