title: Extending Application
body: <p>I'd like to extend Application in my Android app.  I've done this such that I've created an extended Application object called MyApplication and added it to the manifest.</p>
  
  <p>I'd now like to add some getters and setters to hold some information.  It looks like I'll need to pass the application Context to any classes which do not contain a Context.</p>
  
  <p>For example, say I create a class called MyObject (in its own java file):</p>
  
  <pre><code>public class MyObject {
    public void doStuff() {
      // do stuff
    }
  }
  </code></pre>
  
  <p>How might I access MyApplication from doStuff()?  It looks like I'll need to pass the application Context to MyObject.  Is this typical?  Is there a possibility of leaks?</p>
  
  <p>Also, to make sure I'm clear, will MyApplication (and the variables within) live throughout the application's lifecycle, or not?  Either way is fine.  I just want to make sure I account for this if I need to.</p>
  
  <p>And lastly, any links to some example source to show what different things extending Application is useful for would be appreciated.</p>