0
votes

Eclipse is giving me this error in my activity_main.xml file, but I'm not sure why...

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/titlebar"
android:orientation="horizontal"
android:padding="8dip" >

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:padding="0dp"
    android:text="create account"
    android:textColor="#FFFFFF"
    android:textSize="32sp"
    android:textStyle="bold"
    android:typeface="sans" />

<com.viewpagerindicator.TabPageIndicator
    android:id="@+id/indicator"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent" />

<android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    />

</LinearLayout>

(The error annotation appears on the line where the com.viewpagerindicator... tab begins) Any help or ideas would be appreciated. Thanks.

2
Can you please post full error log? - MysticMagicϡ
How do I get the error log? Sorry, I'm new to Eclipse - Aaron Mampáro
From Window > Show View > Logcat - MysticMagicϡ

2 Answers

2
votes

You need to add:

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

below the android namespace.

0
votes

Try to put

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

at the very top of your xml file. So the resulting xml should look like:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:background="@drawable/titlebar"
    android:orientation="horizontal"
    android:padding="8dip" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:padding="0dp"
        android:text="create account"
        android:textColor="#FFFFFF"
        android:textSize="32sp"
        android:textStyle="bold"
        android:typeface="sans" />

    <com.viewpagerindicator.TabPageIndicator
        android:id="@+id/indicator"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>