开发者

cannot be resolved or is not a field [closed]

开发者 https://www.devze.com 2023-03-15 03:40 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a s开发者_StackOverflowpecific moment in time,or an extraordinarily narrow situation that is
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a s开发者_StackOverflowpecific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

i would like to ask how can i solve this problem ..

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    textOut =(TextView) findViewById(R.id.tvGetInput);
    getInput = (EditText) findViewById(R.id.etInput);
    Button ok = (Button) findViewById (R.id.bOk);
    ok.setOnClickListener(new View.OnClickListener() {

(the tvGetInput, etInput ,bOk has the error) it says "cannot be resolve or is not a field"


first , clean an re-build your project like this :

Project ==> Clean ==> Check your project and press OK.

second , verify your imports, if there is the import android.R , delete it , you should import the R of your project :

example : import com.test.R;

Regards


Check your imports. There shan't be android.R. Also check if you declared these ids in your main layout. If all is ok, clean and build your project.

0

精彩评论

暂无评论...
验证码 换一张
取 消