title: integrate google plus android error
body: <p><a href="https://developers.google.com/+/mobile/android/getting-started" rel="nofollow">https://developers.google.com/+/mobile/android/getting-started</a>
  This is my code:</p>
  
  <pre><code>public class MainActivity extends Activity implements ConnectionCallbacks, OnConnectionFailedListener{
   private static final int RC_SIGN_IN = 0;
  
    /* Client used to interact with Google APIs. */
    private GoogleApiClient mGoogleApiClient;
    /* A flag indicating that a PendingIntent is in progress and prevents
     * us from starting further intents.
     */
    private boolean mIntentInProgress;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API, null).addScope(Plus.SCOPE_PLUS_LOGIN).build();
      setContentView(R.layout.activity_main);
  }
  protected void onStart() {
      super.onStart();
      mGoogleApiClient.connect();
    }
  
    protected void onStop() {
      super.onStop();
      if (mGoogleApiClient.isConnected()) {
        mGoogleApiClient.disconnect();
      }
    }
    public void onConnectionFailed(ConnectionResult result) {
        if (!mIntentInProgress &amp;&amp; result.hasResolution()) {
          try {
            mIntentInProgress = true;
            result.startResolutionForResult(this, RC_SIGN_IN);
          } catch (SendIntentException e) {
            // The intent was canceled before it was sent.  Return to the default
            // state and attempt to connect to get an updated ConnectionResult.
            mIntentInProgress = false;
            mGoogleApiClient.connect();
          }
        }
      }
  
      public void onConnected(Bundle connectionHint) {
        // We've resolved any connection errors.  mGoogleApiClient can be used to
        // access Google APIs on behalf of the user.
      }
      protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
            if (requestCode == RC_SIGN_IN) {
              mIntentInProgress = false;
  
              if (!mGoogleApiClient.isConnecting()) {
                mGoogleApiClient.connect();
              }
            }
          }
      @Override
      public void onConnectionSuspended(int arg0) {
          mGoogleApiClient.connect();
      }
  }.
  </code></pre>
  
  <p>At first, i see the line <code>mIntentInProgress == false;</code>  and receive error:<br>
  <code>Syntax error on token "==", invalid AssignmentOperator</code> so i changed to <code>mIntentInProgress = false;</code> but then, when i run, it crashes.<br>
  Logcat:.......................    </p>
  
  <pre><code>06-30 01:33:49.186: E/AndroidRuntime(2776): FATAL EXCEPTION: main    
  06-30 01:33:49.186: E/AndroidRuntime(2776): Process: com.example.oauth, PID: 2776    
  06-30 01:33:49.186: E/AndroidRuntime(2776): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.oauth/com.example.oauth.MainActivity}: java.lang.NullPointerException: Null options are not permitted for this Api
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread.access$800(ActivityThread.java:135)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.os.Handler.dispatchMessage(Handler.java:102)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.os.Looper.loop(Looper.java:136)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread.main(ActivityThread.java:5017)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at java.lang.reflect.Method.invokeNative(Native Method)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at java.lang.reflect.Method.invoke(Method.java:515)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at dalvik.system.NativeStart.main(Native Method)    
  06-30 01:33:49.186: E/AndroidRuntime(2776): Caused by: java.lang.NullPointerException: Null options are not permitted for this Api    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at com.google.android.gms.internal.fq.b(Unknown Source)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at com.google.android.gms.common.api.GoogleApiClient$Builder.addApi(Unknown Source)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at com.example.oauth.MainActivity.onCreate(MainActivity.java:28)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.Activity.performCreate(Activity.java:5231)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)    
  06-30 01:33:49.186: E/AndroidRuntime(2776):     ... 11 more
  </code></pre>