jersam515
jersam515

Reputation: 657

Android xml graphical layout is not working for eclipse IDE

I am getting a "No XML content. Please add a root view or layout to your document" When the code part of the xml file is as follows:

<?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="fill_parent"
    android:orientation="vertical" >

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

</LinearLayout>

As always help is greatly appreciated.

Upvotes: 0

Views: 1161

Answers (2)

jersam515
jersam515

Reputation: 657

Well, oddly enough it worked today, so for any googlers: wait a day I guess. Thanks everyone for trying to help.

Upvotes: 2

E-Riz
E-Riz

Reputation: 33034

Did you copy+paste this code from somewhere? Maybe there's a non-printable character in there that the XML processor is encountering and throwing it for a loop. As a test, try creating a new layout file and manually typing in the contents from above. If that works, you can throw away the file above and use the new one.

Upvotes: 0

Related Questions