zoukankan      html  css  js  c++  java
  • Error parsing XML: junk after document element java程序员

    今天开始接触android的Java编程,出现问题了。

    我的代码是这样的:

    <LinearLayout 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"
        android:orientation="horizontal"
        tools:context=".MainActivity" >

    </LinearLayout>

    <EditText android:id="@+id/edit_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:hint="@string/edit_message"/>
    <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send" />

    应该把</LinearLayout>放在最后一行。

    原因:

    这里Android123提示大家一般合法的XML文件只有一个主根节点,比如

    <android123>
        <item1/>
        <item2/>
        <item3/>
    </android123>

    如果出现了Error parsing XML: junk after document element这样的错误,你的想法可能只要主根有多个节点,比如说

     <android123>
        <item1/>
    </android123>
    <android123>
        <item2/>
        <item3/>
    </android123>


  • 相关阅读:
    poj 3278 catch that cow
    POJ 1028 Web Navigation
    poj 2643 election
    hdu 1908 double queues
    hdu_2669 Romantic(扩展欧几里得)
    0/1背包 dp学习~6
    校验码
    最长上升子序列(LIS经典变型) dp学习~5
    LCS最长公共子序列~dp学习~4
    最长上升子序列(LIS) dp学习~3
  • 原文地址:https://www.cnblogs.com/java20130725/p/3215471.html
Copyright © 2011-2022 走看看