title: common runonUIthread for whole application
body: <p>So, I am designing an android application that interacts with some hardware over a bluetooth dongle. </p>
  
  <p>The request/response model is a little slow (sometimes it takes 1-2 seconds to receive a response to a particular request) and hence I have kept the request sent and response received model in a different thread.</p>
  
  <p>To achieve the same I have created an interface <code>ResultPoster</code> with some callback methods like <code>onMyResponse()</code>.</p>
  
  <p>This interface is implemented by various <code>Activity</code> and UI components of my application, but as we know that we simply can't post to <strong>UI or Main</strong> thread directly from another thread therefore I use <code>runOnUIthread</code> in all the UI components (Activities or Fragments basically). </p>
  
  <p>e.g.</p>
  
  <pre><code>runOnUiThread(new Runnable() {
  @Override
  public void run() {
  stopProgressDialog();
  launchActivity();
  }
  });  
  </code></pre>
  
  <p>There are a lot of such blocks present in my code now and they are increasing as some logic gets complex.</p>
  
  <p><strong>Now, I want to keep my code clean and create a bridge throughout the application that will help me to post results over to UI from another thread, just based upon the <code>context</code> that I am into. 
  Can you suggest me some other approach ?</strong></p>
  
  <p>-Edit-</p>
  
  <p><strong>Is this an overkill to use multiple such code blocks in various Activities to achieve the same ?</strong></p>