title: How to use Handler and handleMessage in Kotlin?
body: <p>Java code:</p>
  
  <pre><code>private final Handler mHandler = new Handler() {
      @Override
      public void handleMessage(Message msg) {
         // code here
      }
  };
  </code></pre>
  
  <p>How to convert this java code to Kotlin?</p>
  
  <p>I tried this:</p>
  
  <pre><code>private val mHandler = object : Handler() {
      fun handleMessage(msg: Message) {
         // code here
      }
  }
  </code></pre>
  
  <p>But this is seems to be incorrect and gives a compile time error on <code>object</code></p>