title: Android Fragment Re-Instantiation Error
body: <p>I thought I had my conversion to fragments pretty well done until I rotated the screen. I am getting the following types of errors:</p>
  
  <p>RuntimeException: Unable to start activity ComponentInfo{com.ghcssoftware.gedstar/com.ghcssoftware.gedstar.GedStar}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.ghcssoftware.gedstar.PersonTab$PersonTabFrag: make sure class name exists, is public, and has an empty constructor that is public</p>
  
  <p>The class in question does exist, is public, and I added an empty constructor with no change in the results. Looking at some sample code, I do notice some differences from the way my code is written, although I don't see empty constructors either:</p>
  
  <p>1) Is there any reason that my fragment class should be declared "static" as many samples are?</p>
  
  <p>2) Do I need to implement the use of "newInstance" within my fragment class? Why is this done instead of just having a constructor? For example from one of the V14 samples:</p>
  
  <pre><code>public static class CountingFragment extends Fragment {
      int mNum;
  
      /**
       * Create a new instance of CountingFragment, providing "num"
       * as an argument.
       */
      static CountingFragment newInstance(int num) {
          CountingFragment f = new CountingFragment();
  
          // Supply num input as an argument.
          Bundle args = new Bundle();
          args.putInt("num", num);
          f.setArguments(args);
  
          return f;
      }
  </code></pre>
  
  <p>I'm still a bit unfamiliar with some Java concepts, so may be missing something basic here.</p>
  
  <p>Doug Gordon
    GHCS Software</p>