title: android - start an activity onTouch
body: <p>In my app I have a countdown which counts from five to one. At the moment, the counter starts as soon as the activity is started. What I want is to stay at 5 seconds and wait to count down until the screen is touched. So the countdown timer should be started which a touch event.</p>
  
  <pre><code>    public class MainActivity extends Activity implements OnGestureListener {
      private static final String FORMAT = "%02d:%02d";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_game);
  
          new CountDownTimer(5000, 10) {
              public void onTick(long millisUntilFinished) {
                  text.setText("" + String.format("%02d:%03d",
                          TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished)),
                          TimeUnit.MILLISECONDS.toMillis(millisUntilFinished) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished))
                  ));
  
                  if (animationRunning) {
                      cancel();
                  }
              }
  
              public void onFinish() {
                  text.setText("done!");
              }
          }.start();
      }
  
  
      @Override
      public boolean onTouchEvent(MotionEvent touchevent) {
  
      }
  }
  </code></pre>