Advertisement
Guest User

Untitled

a guest
Jan 29th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1. answer1.setOnClickListener(new View.OnClickListener() {
  2.             @Override
  3.             public void onClick(View view) {
  4.                 if(answer1.getText() == mAnswer) {
  5.                     mScore++;
  6.                     score.setText("Punkte: " + mScore);
  7.                     answer1.setBackgroundResource(R.color.colorCorrect);
  8.                     try {
  9.                         Thread.sleep(3000);
  10.                     } catch (InterruptedException ex) {
  11.                         System.out.println("Error");
  12.                     }
  13.                     fragezaehler.setText(mQuestionNumber + "/" + mQuestionLength);
  14.                     updateQuestion(mQuestionNumber++);
  15.                 }
  16.                 else{
  17.                     score.setText("Punkte: " + mScore);
  18.                     answer1.setBackgroundResource(R.color.colorFalse);
  19.                     try {
  20.                         Thread.sleep(3000);
  21.                     } catch (InterruptedException ex) {
  22.                         System.out.println("Error");
  23.                     }
  24.                     fragezaehler.setText(mQuestionNumber + "/" + mQuestionLength);
  25.                     updateQuestion(mQuestionNumber++);
  26.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement