title: Android fragments hide show OnHide/OnShow?
body: <p>I am asking this cuz I am sort of curious. </p>
  
  <p>1 ) Most google demos  finds fragments by its ID if the fragment is already been created in xml. </p>
  
  <p>So if we take that approach, the way we show fragments is by hiding it and showing it since the fragments are already created. </p>
  
  <p>2) There are also examples provided by google where you can create the fragment with a constructor and inflate it. This acts weird by the way like getActivity() returns null if it is called with in that fragment. </p>
  
  <p>So If i take the first approach I have to hide and show the fragments. 
  So why does not google provide hooks to the fragments like  onHide or onShow
  so that we can handle things properly instead if doing the clean up ourselves with functions that we implement and call explicitly. </p>