我收到“没有XML内容。请在文档中添加根视图或布局”当xml文件的代码部分如下所示:
<?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>
一如既往,非常感谢帮助。
答案 0 :(得分:2)
嗯,奇怪的是它今天起作用了,所以对于任何一个googlers:等一天我猜。感谢大家的帮助。
答案 1 :(得分:0)
您是否从某处复制+粘贴此代码?也许有一个不可打印的字符,XML处理器正在遇到并将其抛出循环。作为测试,尝试创建新的布局文件并手动输入上面的内容。如果可行,您可以丢弃上面的文件并使用新文件。