调用后void方法内的setText未更新


@Override
public void onAnimationEnd(Animation animation) {
Toast.makeText(PlayQuiz.this, "END", Toast.LENGTH_SHORT).show();
//Show next question
showNextQuestion();
mOptionTwoTextView.setText("Hell Yeah");
}

private void showNextQuestion() {
mThisQuestion = mDummyQuestionList.get(mTHisQuestionID++);
//Set Questions and Options
mQuestionTextView.setText(mThisQuestion.getQuestion());
mOptionOneTextView.setText(mThisQuestion.getOptionOne());
mOptionTwoTextView.setText(mThisQuestion.getOptionTwo());
mOptionThreeTextView.setText(mThisQuestion.getOptionThree());
mOptionFourTextView.setText(mThisQuestion.getOptionFour());
}

在animationEnd内部,设置的文本工作得很好,但调用此void后,它应该更改文本,但没有更改文本。

@Override
public void onAnimationEnd(Animation animation) {

// execute methods in main thread
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toast.makeText(PlayQuiz.this, "END", Toast.LENGTH_SHORT).show();
showNextQuestion();
mOptionTwoTextView.setText("Hell Yeah");

}
});
}

最新更新