Advertisement
jurgemaister

ResultActivity.java

Jan 11th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. public class ResultActivity extends ParentActivity implements View.OnClickListener {
  2.  
  3.     @Override
  4.     public void onCreate(Bundle savedInstanceState) {
  5.         Button newTestButton = (Button) findViewById(R.id.newTestButton);
  6.  
  7.         newTestButton.setText(ab.i18n("Start new test"));
  8.         newTestButton.setOnClickListener(new View.OnClickListener() {
  9.             public void onClick(View v) {
  10.                 doStartTest();
  11.             }
  12.         });
  13.  
  14.         Button doneButton = (Button) findViewById(R.id.doneButton);
  15.         doneButton.setText(ab.i18n("Home"));
  16.         doneButton.setOnClickListener(new View.OnClickListener() {
  17.             public void onClick(View v) {
  18.                 doFinish();
  19.             }
  20.         });
  21.     }
  22.  
  23.     private void doStartTest() {
  24.         Intent intent = new Intent(this, HomeActivity.class);
  25.         intent.putExtra("startTest", true);
  26.         intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  27.         startActivity(intent);
  28.     }
  29.  
  30.     private void doFinish() {
  31.         Intent intent = new Intent(this, HomeActivity.class);
  32.         intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  33.         startActivity(intent);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement