This is a question about XML errors in Android application development.

Asked 2 years ago, Updated 2 years ago, 100 views

I am currently editing XML and Java files.
Unable to handle errors in XML.

The location of the error is

in the first line.
<?xml version="1.0" encoding="utf-8"?>

That's right.

As an error indication,

Multiple annotations found on this line:
- Use processing instruction targets that match "[xX][mM][llL]"
Not available.
- error:Error parsing XML:junk after
document element

Also, the code is listed below.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/layout_root"android:layout_width="fill_parent"android:layout_height="fill_parent"xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical">
    <TabHost
        android: id="@+id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <LinearLayout
        android: id="@+id/linearLayout1"
        android:layout_width="fillparent"
        android:layout_height="fillparent"
        android: orientation="vertical">
    <TabWidget
        android:layout_width="fillparent"
        android:layout_height="wrap_content"
        android:id="@android:id/tabs">/TabWidget>
    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@android:id/tabcontent">
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android: id="@+id/contentlayout1">
    </LinearLayout>
    </FrameLayout>
    </LinearLayout>
    </TabHost>
    </LinearLayout>

android java android-layout xml

2022-09-30 18:56

1 Answers

The XML declaration (<?xml version="1.0" encoding="utf-8"?>) must be at the beginning of the file and cannot be preceded by comments.


2022-09-30 18:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.