Google Signin API called even button is not pressed?
<p>I tried to implement google sign in api, but every time I opened the app, even I didnt click sign in button, button click is called in the code and throw exception that in if (result.isSuccess()) that result is null, anyone knows why?</p>

<pre><code> public class Login extends FragmentActivity {

         private static final int RC_SIGN_IN = 2222;
         protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                                       .requestEmail()
                                       .build();
              mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext())
                                 .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
                                 .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
                                 .build();           
              google_Button = (SignInButton) findViewById(R.id.sign_in_button);
              google_Button.setOnClickListener(this);
    }


        public void onClick(View v) {
                 switch (v.getId()) {
                     case R.id.sign_in_button:
                     Log.d("Result: ","click google");
                     signIn();
                     break;

        }
    }


         private void signIn() {
            Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
            startActivityForResult(signInIntent, RC_SIGN_IN);
    }
        public void onActivityResult(int requestCode, int resultCode, Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            if(requestCode == RC_SIGN_IN) {
            Log.d("Result: ","google sign in");
            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
            handleSignInResult(result);
        }

    }


        private void handleSignInResult(GoogleSignInResult result) {

        if (result.isSuccess()) {
            GoogleSignInAccount acct = result.getSignInAccount();
              Log.d("Google token: ",result.getSignInAccount().getEmail());
        } else {            
            Log.d("Google","fail");
        }
    }
</code></pre>