title: How to countdown days in android application?
body: <p>Last day I tried to create a countdown for 77 days left. I did it, but the problem is that my countdown is working with milliseconds, and 77 days in milliseconds is exactly 6652800000, and the problem is that if I set my countdown with this value, it shows an error which says: The literal 6652800000 of type int is out of range. How to set it correctly to countdown from the present day to 77 days in the future? Thanks !</p>
  
  <p>Here is my:</p>
  
  <p><strong>MainActivity:</strong></p>
  
  <pre><code>package com.example.dasds;
  
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.widget.TextView;
  
  
  public class MainActivity extends Activity {
  TextView tv; //textview to display the countdown
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  tv = new TextView(this);
  this.setContentView(tv);
  //5000 is the starting number (in milliseconds)
  //1000 is the number to count down each time (in milliseconds)
  MyCount counter = new MyCount(6652800000,86400000);
  counter.start();
  }
  //countdowntimer is an abstract class, so extend it and fill in methods
  public class MyCount extends CountDownTimer{
  public MyCount(long millisInFuture, long countDownInterval) {
  super(millisInFuture, countDownInterval);
  }
  @Override
  public void onFinish() {
  tv.setText("Done");
  }
  @Override
  public void onTick(long millisUntilFinished) {
  tv.setText("Left: " + millisUntilFinished/86400000);
  }
  }
  }
  </code></pre>