jurgemaister

TestActivity.java

Jan 11th, 2013
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. public class TestActivity extends ParentActivity {
  2.  
  3.     @Override
  4.     protected void onCreate(Bundle savedInstanceState) {
  5.         nextButton = (Button) findViewById(R.id.nextButton);
  6.         nextButton.setOnClickListener(new View.OnClickListener() {
  7.             public void onClick(View v) {
  8.                 nextQuestion();
  9.             }
  10.         });
  11.     }
  12.  
  13.     private void nextQuestion() {
  14.         if (currentTest.incrementQuestionIndex()) {
  15.             drawQuestion();
  16.         } else {
  17.             finishTest();
  18.         }
  19.     }
  20.  
  21.     private void finishTest() {
  22.         user.saveTest(currentTest);
  23.         Intent intent = new Intent(this, ResultActivity.class);
  24.         startActivity(intent);
  25.         finish();
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment