title: Restart a timer after calling cancel()
body: <p>I need to restart a timer on <code>onResume()</code> because on <code>onPause()</code> I call <code>timer.cancel()</code>. How can I do this?</p>
  
  <p>Here is the code where I start the timer :</p>
  
  <pre><code> handler = new Handler();
          t = new Timer();
          t.scheduleAtFixedRate(new TimerTask() {
              @Override
              public void run() {
  
                  runOnUiThread(new Runnable() {
                      public void run() {
                          doReload2();
                          populate();
  
  
                      }
                  });
  
              }
  
          }, 300, 30000);
  </code></pre>
  
  <p>and here I cancel the timer :</p>
  
  <pre><code>@Override
  protected void onPause() {
      super.onPause();
      System.out.println("onPause!!!!!!");
      t.cancel();
  }
  </code></pre>