title: How to initialize a handler in Android Studio?
body: <p>I've been trying to do timed tasks with a handler in Android Studio, but when I try to initialize it, this happens:</p>
  
  <pre><code>private Handler handler = new Handler() {
          @Override
          public void publish(LogRecord record) {
  
          }
  
          @Override
          public void flush() {
  
          }
      @Override
      public void close() throws SecurityException {
  
      }
  };
  </code></pre>
  
  <p>Whenever I look at online examples where people use Handlers to execute code at intervals, their declarations look as such:</p>
  
  <pre><code>private Handler handler = new Handler();
  </code></pre>
  
  <p>How do I avoid the big jumble of methods within the Handler?</p>