title: How can I separate Logic/UI in Android
body: <p>I want as my application to be structured in 2 parts: the logic code and the UI.</p>
  
  <p>I've tried to implement that using a controller class(here I keep the logic code) inside of each activity. 
  The activity send messages to controller and receive the answer in two ways:</p>
  
  <ol>
  <li>the answer is returned immediately (if the action is not complex and it can be done in a verry short time)</li>
  <li><p>the activity set some listeners and the controller fire this listener when the action is complete.</p>
  
  <p>The problems appears when  the controller have a lot of objects(each object should handle a set of actions and for each action I have to set &amp; trigger a listener): it is hard to keep the code syncronized.</p>
  
  <p>I'm asking if you know a better way to implement this mechanism.</p>
  
  <p>Thank you.</p></li>
  </ol>