title: send message to Thread which is listening for data from network
body: <p>I have an Android app which has the following key components</p>
  
  <p>A service which manages a connection thread
  A connection thread which connects to IRC and listens for messages from the connection
  A ui which is bound the the service.</p>
  
  <p>I have a button on the UI and I need to send a message to the irc server when the button is clicked. My idea was to spawn a handler on the connection thread, get a handle to it in my service and then send messages from the UI to the services and from there to the thread.</p>
  
  <p>When I created a handler at class level in the thread I get a networkonuiexception.  I moved instantiation of my handler to the run() method and I get told to use a Looper.prepare(). I feel that I have approached this wrong and I am looking for advice on how best to manage this.</p>
  
  <p>Any help would be appreciated.</p>