在layout 文件夹下新建一个xml文件和新建的Activity类 ,当新建xml文件后报错,错误如下
[2011-07-01 00:49:53 - helloWorld] E:\android\dome\res\layout\Second.xml:2: error: Error parsing XML: no element found
[2011-07-01 00:51:03 - helloWorld] res\layout\Second.xml: Invalid file name: must contain only [a-z0-9_.]SecondActivity.java 源码
package com.wyz.hello.activity;import android.app.Activity;
import android.os.Bundle;public class SecondActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}}second.xml 源码
<?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"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/wyz"
/>
<Button
android:id="@+id/second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="second"
/>
</LinearLayout>
[2011-07-01 00:49:53 - helloWorld] E:\android\dome\res\layout\Second.xml:2: error: Error parsing XML: no element found
[2011-07-01 00:51:03 - helloWorld] res\layout\Second.xml: Invalid file name: must contain only [a-z0-9_.]SecondActivity.java 源码
package com.wyz.hello.activity;import android.app.Activity;
import android.os.Bundle;public class SecondActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}}second.xml 源码
<?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"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/wyz"
/>
<Button
android:id="@+id/second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="second"
/>
</LinearLayout>
解决方案 »
- make: *** No rule to make target libbluez-common-static.a
- 请教:点击listview每行空白处无onItemClick事件生成?
- listview中显示一个imageview
- win7下Eclipse建立android项目时报错(有图),求解决方法
- 文件上传
- 疯狂Android讲义的QQ群
- activity跳转的问题
- 请问关于TextView的问题
- android界面中有多个按钮,有时候会发生阻塞
- 小妹想研究一下手机app真么设计的,如何查看现成app怎么设计的?
- android 创建bitmap 路径到底怎么写
- android 删除sqlite数据库,为什么模拟器中执行成功,设备上删除不成功?
无效文件名 必须只包含a~z 0~9 .,不能有大写