최근 NetBeans 7.1.1과 NBAndroid 1.11 플러그인을 설치했습니다. 새로운하여 HelloWorld 프로젝트를 시작한 후, 나는 테스트 코드에서 다음과 같은 오류가 발생합니다 : 된 setContentView 기능에 대한 문제를 일으키는NetBeans with NBAndroid - 기호를 찾을 수 없습니다. setContentView (R.layout.main);
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);
}
}
: 여기
는 HelloWorldMain.java 파일 내 소스 코드 몇몇 이유. R.java 파일에서 오류가 있는지 확인했는데 아무 것도 찾을 수 없었습니다.C:\Users\Daniel\Documents\NetBeansProjects\HelloWorld\src\Hello\World\HelloWorldMain.java:14: error: cannot find symbol setContentView(R.layout.main);
/* 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;
}
}
도움이 되셨을 것입니다.
와우, 내가 android.R 가져 오기를 추가해야한다고 오류가 오기 전에. 이제는 그것 없이도 작동합니다. –