Saturday

Error parsing XML: unbound prefix, Most relevant problems in android

During creating different layout in android using xml, may be sometimes miss small things, that is necessary to create layouts.

Xml Layout File:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    <TextView
        android:text="Top Title"
        android:id="@+id/TextView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true">
    </TextView>
</RelativeLayout>

In eclipse you should looks like this error:


How to solve this problems. lets talk some tips:

 Most important this aspect you forget to put, this :

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


you just put this on main or first node of xml layout;

Like this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    <TextView
        android:text="Top Title"
        android:id="@+id/TextView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true">
    </TextView>
</RelativeLayout>

I think, now your problem solve.

Please dontt forget this problem on google.

Have a fun with solved problem and Happy Coding!!!

0 comments

Posts a comment

Related Posts  www.prandroid.com...
 
© 2011 Android Programming Tutorails | 2012 Templates
Designed by Blog Thiết Kế
Back to top