title: Android - Timer function and alertDialog
body: <p>I created a game with timer, I am trying to make that when the timer is end the player will see alert popup or any kind of pop up that say "level complete", your points are xxx and a button for next level. I tried something but the time over but no popup. 
  any idea?</p>
  
  <p><strong>Time Class: work fine.</strong></p>
  
  <p>public class Time {</p>
  
  <pre><code>private String time;
  private boolean isDone;
  
  public Time() {
      super();
      isDone=false;
  }
  
  CountDownTimer count = new CountDownTimer(5000, 1000) {
  
  public void onTick(long millisUntilFinished) {
  
      int seconds = (int) (millisUntilFinished / 1000);
      int minutes = seconds / 60;
      seconds = seconds % 60;
      String tempSec=Integer.toString(seconds);
      if (tempSec.length()==1){
          tempSec="0"+tempSec;
      }
      time="Time Left: " + minutes + ":"+tempSec;
   }
  
   public void onFinish() {
      setDone(true);
  }
  
  }.start(); 
  </code></pre>
  
  <p><strong>This is the Activity class:</strong></p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
  
      club=new Club();
      clubView = new ClubView(this, club);
      mole=new Mole();
      stageView=new StageView(this);
      moleView=new MoleView(this,mole);
      pointsView=new PointsView(this);
  
      time=new Time();
      timerView=new TimerView(this, time);
  
      allViews=new AllViews(this);
      allViews.setViews(stageView, moleView, pointsView, timerView,clubView);
  
      setContentView(allViews);
      allViews.setOnTouchListener((View.OnTouchListener)this);
  
      if (timerView.getTime().isDone()){
          AlertDialog.Builder builder = new AlertDialog.Builder(this);
          builder.setMessage("Level Complete");
          builder.setMessage("your score is"+pointsView.getPoint());
          AlertDialog dialog = builder.create();
          dialog.show();
      }
  
  }
  </code></pre>