title: How to Define Callbacks in Android?
body: <p>During the most recent Google IO, there was a presentation about implementing restful client applications. Unfortunately, it was only a high level discussion with no source code of the implementation.</p>
  
  <p>In this diagram, on the return path there are various different callbacks to other methods. </p>
  
  <p><a href="https://i.stack.imgur.com/7y0wd.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/7y0wd.gif" alt="google io presentation slide"></a></p>
  
  <p><strong>How do I declare what these methods are?</strong> </p>
  
  <p>I understand the idea of a callback - a piece of code that gets called after a certain event has happened, but I don't know how to implement it. The only way I've implemented callbacks so far have been overriding various methods (onActivityResult for example).</p>
  
  <p>I feel like I have a basic understanding of the design pattern, but I keep on getting tripped up on how to handle the return path.</p>