Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. timer.cancel()
  2.  
  3. alert.setPositiveButton("YES", new DialogInterface.OnClickListener() {
  4.  
  5. @Override
  6. public void onClick(DialogInterface dialog, int which) {
  7. Toast.makeText(getApplicationContext(),"Game is restarted",Toast.LENGTH_SHORT).show();
  8.  
  9. Intent intent= getIntent();
  10. finish();
  11. startActivity(intent);
  12. }
  13. });
  14.  
  15. alert.setNegativeButton("NO",new DialogInterface.OnClickListener(){
  16.  
  17. @Override
  18. public void onClick(DialogInterface dialog, int which) {
  19. Toast.makeText(getApplicationContext(),"Process cancelled",Toast.LENGTH_SHORT).show();
  20.  
  21. if(timeText.getText().toString().equals("Time's done !")){
  22. disableImages(false);
  23. timer.cancel();
  24. }
  25. else{
  26. activateImages(true);
  27. resumeTimer();
  28. }
  29. }
  30. });
  31.  
  32. alert.setCancelable(false);
  33.  
  34. alert.show();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement