title: How can I save a Realm object inside an IntentService?
body: <p>I am getting the following Exception when I try to save a Realm object inside an IntentService.  My guess is that the Service is killed before the Realm save actually happens, but I'm not sure how to fix this?</p>
  
  <pre><code>11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue: Handler (android.os.Handler) {febe2b0} sending message to a Handler on a dead thread
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue: java.lang.IllegalStateException: Handler (android.os.Handler) {febe2b0} sending message to a Handler on a dead thread
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.enqueueMessage(Handler.java:631)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.sendMessageAtTime(Handler.java:600)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.sendMessageDelayed(Handler.java:570)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.sendEmptyMessageDelayed(Handler.java:534)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.sendEmptyMessage(Handler.java:519)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at io.realm.BaseRealm.commitTransaction(BaseRealm.java:330)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at io.realm.Realm.commitTransaction(Realm.java:113)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at io.realm.Realm.executeTransaction(Realm.java:1038)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at com.weightbook.database.manager.DataRecordManager.saveDataRecord(DataRecordManager.java:14)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at com.weightbook.sync.DataRecordUtils.updateDataRecordIndexes(DataRecordUtils.java:42)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at com.weightbook.service.ListeningToWearService.onDataChanged(ListeningToWearService.java:164)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at com.google.android.gms.wearable.WearableListenerService$zza$1.run(Unknown Source)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.handleCallback(Handler.java:739)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Handler.dispatchMessage(Handler.java:95)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.Looper.loop(Looper.java:148)
  11-17 10:44:12.823 30368-11042/com.weightbook W/MessageQueue:     at android.os.HandlerThread.run(HandlerThread.java:61)
  11-17 10:44:12.823 30368-11042/com.weightbook W/REALM: Cannot update Looper threads when the Looper has quit. Use realm.setAutoRefresh(false) to prevent this.
  </code></pre>