我最近使用NB
Android 1.11插件安装了NetBeans 7.1.1.启动一个新的HelloWorld项目后,我从测试代码中收到以下错误:
C:\Users\Daniel\Documents\NetBeansProjects\HelloWorld\src\Hello\World\HelloWorldMain.java:14:
error: cannot find symbol
setContentView(R.layout.main);
这是我的HelloWorldMain.java文件的源代码:
package Hello.World;
import android.R;
import android.app.Activity;
import android.os.Bundle;
public class HelloWorldMain extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
setContentView函数由于某种原因导致问题.我检查了R.java文件是否有任何错误,似乎没有找到任何错误:
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package Hello.World;
public final class R {
public static final class attr {
}
public static final class layout {
public static final int main=0x7f020000;
}
public static final class string {
public static final int app_name=0x7f030000;
}
}
任何帮助,将不胜感激.