You forgot to mark your variables to be bound by the UiBinder. Just add @UiField
annotations to both Button abgabe
and CheckBox answer
declarations, like this:
@UiField
Button abgabe;
@UiField
CheckBox answer;
BTW: answer.isChecked()
is deprecated. Use answer.getValue()
instead. And you don't have to compare boolean value with true
in if
clause. if(answer.getValue())
is good enough.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…