---
title: "请教一个HelloWorld的问题。。。谢谢"
author: "jackey25"
date: "2011-01-27T00:07:53Z"
tags: []
categories: ["移动开发"]
slug: "helloworld"
draft: false
lastmod: "2011-01-27T00:07:53Z"
id: 897860
url: "https://jackey25.iteye.com/blog/897860"
---

大家好，我刚装完了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仍然报错，请问是不是哪里我没有配置好呢？

谢谢