Android应用程序,必须在良好的根元素下列文件中的标记 [英] Android app, The markup in the document following the root element must be well-formed

查看:230
本文介绍了Android应用程序,必须在良好的根元素下列文件中的标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始从下面的链接模块6.1项目工作的一些Android的教程演示的 http://www.vogella.de/articles/Android/article.html

I had started to work on some android tutorial demo's from below link module 6.1 Project http://www.vogella.de/articles/Android/article.html

我收到以下错误通知在日食用于以下menu.xml文件菜单标签:

Am getting following error notification in eclipse for the menu tag in below menu.xml:

The markup in the document following the root element must be well-formed.

menu.xml文件(路径:/ RES /菜单)

menu.xml (path: /res/menu)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Button android:id="@+id/Button01" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Show Preferences"></Button>
    <Button android:id="@+id/Button02" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Change Preferences"></Button>
</LinearLayout>
   <menu xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:title="Prefernces" android:id="@+id/Prefernces"></item>
</menu>

在控制台我收到以下错误:

In console am getting following error:

[2011-08-17 14:47:00 - Preferences] D:\AndroidWorkSpace\Preferences\res\menu\menu.xml:10: error: Error parsing XML: junk after document element
[2011-08-17 14:47:02 - Preferences] W/ResourceType( 3524): Bad XML block: no root element node found
[2011-08-17 14:47:02 - Preferences] D:\AndroidWorkSpace\Preferences\res\menu\menu.xml:10: error: Error parsing XML: junk after document element

我失去了一些东西。

am i missing some thing.

推荐答案

在哪里,最后菜单标签从何而来? 您应该只有一个根(即第一级)的标签,这将是的LinearLayout 在这里。

Where do the last menu tag come from? You should only have one root (ie 1st level) tag, which would be LinearLayout here.

这篇关于Android应用程序,必须在良好的根元素下列文件中的标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆