title: Is it safe to keep an application Context and use it for Toast and SharedPreferences?
body: <ol>
  <li><p>How I get a Application Context:</p>
  
  <pre><code>private static OBDApplication mInstance;
  
  public static OBDApplication getInstance () {
      return mInstance;
  }
  @Override
  public void onCreate () {
      super.onCreate();
      mInstance = this;
  }
  </code></pre></li>
  <li><p>I know that application Context can't be used everywhere, for example, <code>Dialog</code> and <code>startActivity</code>. And I know, I should always let the reference  with activity Conetxt finish when activity destroyed. But I notice that,<code>Toast</code> and <code>SharedPreferences</code> can use application Context, and it seems to be very innocent that would not lead to a memory leak.</p></li>
  <li><p>So what am I suppose to do? If the problems above does not exist, then things can be cool:</p>
  
  <pre><code>public static void toast ( @StringRes int resID){
      Toast.makeText(OBDApplication.getInstance().getApplicationContext(), resID, Toast.LENGTH_SHORT).show();
  }
  </code></pre></li>
  <li><p>But I know easiest way, so I took some time to search but I get some opposite opinions.</p>
  
  <p>Someone said: <em>"it's bad to use application Context, cause while activity destroy, the toast of this activity should release too, but if u use application Context which means it's life is as long as the application. So is kind of waste"</em>.</p>
  
  <p>However, someone said: <em>"it's good to use application Context, cause in this case, you always use a same object , a same toast ,that means it will not produce new toast again and again"</em>.</p></li>
  </ol>