title: This Handler class should be static or leaks might occur: IncomingHandler
body: <p>I'm developing an Android 2.3.3 application with a service. I have this inside that service to communicate with Main activity:</p>
  
  <pre><code>public class UDPListenerService extends Service
  {
      private static final String TAG = "UDPListenerService";
      //private ThreadGroup myThreads = new ThreadGroup("UDPListenerServiceWorker");
      private UDPListenerThread myThread;
      /**
       * Handler to communicate from WorkerThread to service.
       */
      private Handler mServiceHandler;
  
      // Used to receive messages from the Activity
      final Messenger inMessenger = new Messenger(new IncomingHandler());
      // Use to send message to the Activity
      private Messenger outMessenger;
  
      class IncomingHandler extends Handler
      {
          @Override
          public void handleMessage(Message msg)
          {
          }
      }
  
      /**
       * Target we publish for clients to send messages to Incoming Handler.
       */
      final Messenger mMessenger = new Messenger(new IncomingHandler());
      [ ... ]
  }
  </code></pre>
  
  <p>And here, <code>final Messenger mMessenger = new Messenger(new IncomingHandler());</code>, I get the following Lint warning:</p>
  
  <p><code>This Handler class should be static or leaks might occur: IncomingHandler</code></p>
  
  <p>What does it mean?</p>