ITeye博客

请教一个HelloWorld的问题。。。谢谢

jackey25 · 2011-01-27 00:07 · Java算法练习 · 移动开发 · Markdown

大家好,我刚装完了Android的环境, 想测试一个helloworld程序:

package com.yongfeng.helloworld;

import android.app.Activity; import android.os.Bundle;

public class HelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }

结果提示 R can not be resolved.

如果我引入了包:import android.R;

package com.yongfeng.helloworld;

import android.R; import android.app.Activity; import android.os.Bundle;

public class HelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }

可是R.layout.main仍然报错,请问是不是哪里我没有配置好呢?

谢谢

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。