main无法解析或者不是字段@ helloworld

时间:2014-11-10 23:02:40

标签: java android

所以我刚开始在eclipse中编程,我得到了错误``main无法解析或者不是字段"使用此代码:

package com.example.wouter1;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import com.example.wouter1.R;

public class HelloWorldActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main); // PROBLEM HERE <<<< @ MAIN
        TextView myText = new TextView(this);
        myText.setText("hello world");
        setContentView(myText);
    }
}

0 个答案:

没有答案