title: Why say static activity is a bad practice in Android
body: <pre><code>public static MainActivity mainActivity ;
  
  public static MainActivity instance() {
      return mainActivity  ;
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_navigation);
      mainActivity  = this;
  
  }
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      if (mainActivity  != null) {
          mainActivity  = null;       
      }      
  }
  </code></pre>
  
  <p>Why it will memory leak ?  And why we say this writing is very bad ? 
  I want to understand it from GC principle。</p>