title: Android: It is a good practice to get Context statically?
body: <p>currently, in my App I have the following class:</p>
  
  <pre><code>public class MyApp extends Application {
  
      private static Context context;
  
      public void onCreate(){
          super.onCreate();
          MyApp.context = getApplicationContext();
      }
  
      public static Context getContext() {
          return MyApp.context;
      }
  }
  </code></pre>
  
  <p>I use this to have Context in classes that are neither Activities nor Fragment. It's there any difference between use the context stored on this class and use and activity as context? It is a good practice to have this class or should I provide an activity as context to any class who needs it?</p>
  
  <p>Thanks.</p>