title: Unable to start activity ComponentInfo Error?
body: <p>I'm trying to duplicate the Android Game Services example "Type A Number Challenge" in my own game. It works fine until I log out and then back in, I get an the following error:</p>
  
  <pre><code>09-09 15:23:11.372: E/AndroidRuntime(7438): FATAL EXCEPTION: main
  09-09 15:23:11.372: E/AndroidRuntime(7438): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nurfacegames.testgame06/com.nurfacegames.testgame06.TestGame06}: java.lang.NullPointerException
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1696)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1716)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread.access$1500(ActivityThread.java:124)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.os.Handler.dispatchMessage(Handler.java:99)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.os.Looper.loop(Looper.java:130)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread.main(ActivityThread.java:3806)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at java.lang.reflect.Method.invokeNative(Native Method)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at java.lang.reflect.Method.invoke(Method.java:507)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at dalvik.system.NativeStart.main(Native Method)
  09-09 15:23:11.372: E/AndroidRuntime(7438): Caused by: java.lang.NullPointerException
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.nurfacegames.testgame06.MainMenuFragment.updateUi(MainMenuFragment.java:62)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.nurfacegames.testgame06.MainMenuFragment.onStart(MainMenuFragment.java:49)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.Fragment.performStart(Fragment.java:1528)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:972)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1103)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:1906)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:588)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.google.example.games.basegameutils.BaseGameActivity.onStart(BaseGameActivity.java:110)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at com.nurfacegames.testgame06.TestGame06.onStart(TestGame06.java:518)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.Activity.performStart(Activity.java:3871)
  09-09 15:23:11.372: E/AndroidRuntime(7438):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1669)
  </code></pre>
  
  <p>I've looked at all the places where there is a problem, such as MainMenuFragment at line 49 and 62:</p>
  
  <pre><code> @Override
      public void onStart() {
          super.onStart();
          updateUi();
      }
  
      public void setGreeting(String greeting) {
          mGreeting = greeting;
          updateUi();
      }
  
      void updateUi() {
          if (getActivity() == null) return;
          TextView tv = (TextView) getActivity().findViewById(R.id.hello);
          if (tv != null) tv.setText(mGreeting);
  
          getActivity().findViewById(R.id.sign_in_bar).setVisibility(mShowSignIn ?
                  View.VISIBLE : View.GONE);
          getActivity().findViewById(R.id.sign_out_bar).setVisibility(mShowSignIn ?
                  View.GONE : View.VISIBLE);
          getActivity().findViewById(R.id.screen_menu).setVisibility(mShowScreenMenu ?
                  View.VISIBLE : View.GONE);
      }
  </code></pre>
  
  <p>And TestGame06 at line 518:</p>
  
  <pre><code>//------------------------------------------------------------------
  // @@BEGIN_ACTIVITY_METHODS@@   
  //------------------------------------------------------------------
  @Override
  protected void onStart ( )
  {
      Log.d ( Globals.sApplicationName, "--------------------------------------------" ) ;
      Log.d ( Globals.sApplicationName, "Start activity " + Globals.sApplicationName ) ;
      Log.d ( Globals.sApplicationName, "--------------------------------------------" ) ;
      super.onStart ( ) ;
  }
  </code></pre>
  
  <p>I'm lost on this error, if anyone has some advise or how I can troubleshoot futher, please speak up! Thank you.</p>