title: NullPointerException in logcat with no clues
body: <p>I am violating best practices here trying to figure this out, so to start off with, I realize that and I appreciate any insight. I'm making something simple that relies on a lot of Dialog calls. Nothing fancy, not calling a lot of Fragments. My game will require no permissions.</p>
  
  <p>With the backstory out of the way, I'm getting this NPE:</p>
  
  <pre><code>06-13 01:29:03.581  24690-24690/com.myapp.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.myapp.myapp, PID: 24690
      java.lang.NullPointerException
              at android.widget.FrameLayout.onMeasure(FrameLayout.java:309)
              at android.view.View.measure(View.java:17388)
              at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5353)
              at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
              at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
              at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
              at android.view.View.measure(View.java:17388)
              at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5353)
              at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
              at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2533)
              at android.view.View.measure(View.java:17388)
              at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2217)
              at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1354)
              at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1553)
              at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1238)
              at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6473)
              at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
              at android.view.Choreographer.doCallbacks(Choreographer.java:603)
              at android.view.Choreographer.doFrame(Choreographer.java:573)
              at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
              at android.os.Handler.handleCallback(Handler.java:733)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:157)
              at android.app.ActivityThread.main(ActivityThread.java:5356)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>In my very flat app, I do this:</p>
  
  <pre><code>public static MainActivity ACTIVITY;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          ACTIVITY = this;
          super.onCreate(savedInstanceState);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
          ACTIVITY.setContentView(R.layout.activity_main);
  </code></pre>
  
  <p>Then I do a bunch of stuff that works fine. The problem is, I call a class that does a battle event:</p>
  
  <pre><code>FightEvent thisFight = new FightEvent(this);
      ALLOWSAVE = false;
      thisFight.doFightEvent();
  </code></pre>
  
  <p>In that class, when the fight starts, I do:</p>
  
  <pre><code>ACTIVITY.setContentView(R.layout.activity_fight);
  </code></pre>
  
  <p>When I exit the fight, I do:</p>
  
  <pre><code>ACTIVITY.setContentView(R.layout.activity_main);
  </code></pre>
  
  <p><strong>PLOT TWIST:</strong> This all works fine in older versions. I'm trying to make my game 100% compatible back to API 8.</p>
  
  <p>Works great in API 8. API 19-22, not so much.</p>
  
  <p>Help?</p>