开发者

Android Process closed onClick

I am trying to make a score increment when an answer is shown as correct in a textfield. The code is as follows:

Variable is declared:

static int score = 0;

Method:

 public void score(){

if(check.getText().equals("开发者_如何学编程Correct")){
    score++;
}
Score.setText(String.valueOf(score));
}

The Score is a textfield and check is another textfield

Then this is called in onclick as score();

I appreciate any ideas on why this gets a process closed error when I am clicking the button.

Thanks.

Edit:

Android Process closed onClick


Best advice I can give is set a break point at your if statement then use the debugger to see what is null.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜