id无法解析或不再是字段

时间:2011-10-17 16:20:21

标签: eclipse if-statement field

好的,这是我单个java文件中的代码:

package text.test;


import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

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

    EditText piaf=(EditText)findViewById(R.id.fieldd);
    piaf.setText("Inception" + "The lord of the Rings");

    }


}

我一直收到这个错误! WTF错了?!我试图谷歌寻求答案但没有任何效果!

1 个答案:

答案 0 :(得分:0)

EditText piaf=(EditText)findViewById(R.id.fieldd);

EditText piaf=(EditText)findViewById(R.id.field);

...