title: crash after google sign in and loading into new activity by itself
body: <p><em>my app doesn't go into next activity by itself after google sign in, but if I minimize it or launch again the login page does not come as it(which is nice) and it goes directly to new activity(which I wanted).</em></p>
  
  <p>please look at my code:
  package com.example.patta.pandit;</p>
  
  <pre><code>import android.content.Intent;
  import android.media.MediaPlayer;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.Toast;
  
  import com.google.android.gms.auth.api.signin.GoogleSignIn;
  import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
  import com.google.android.gms.auth.api.signin.GoogleSignInClient;
  import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
  import com.google.android.gms.common.api.ApiException;
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.firebase.auth.AuthCredential;
  import com.google.firebase.auth.AuthResult;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  import com.google.firebase.auth.GoogleAuthProvider;
  
  public class MainActivity extends AppCompatActivity implements View.OnClickListener {
  
  private static final int RC_SIGN_IN = 123;
  private static final String TAG = "Play";
  GoogleSignInClient mGoogleSignInClient;
  FirebaseAuth mAuth;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
      setContentView(R.layout.activity_main);
      MediaPlayer Player = MediaPlayer.create (this, R.raw.bell);
      Player.start();
  
      mAuth = FirebaseAuth.getInstance();
      GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
              .requestIdToken(getString(R.string.default_web_client_id))
              .requestEmail()
              .build();
      mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
      findViewById(R.id.sign_in_button).setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              signIn();
          }
      });
  }
  
  @Override
  public void onStart() {
      super.onStart();
      if (mAuth.getCurrentUser() != null) {
          startActivity(new Intent(this,ClickP.class));
          finish();
      }
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == RC_SIGN_IN) {
          Task&lt;GoogleSignInAccount&gt; task = GoogleSignIn.getSignedInAccountFromIntent(data);
          try {
              GoogleSignInAccount account = task.getResult(ApiException.class);
              firebaseAuthWithGoogle(account);
          } catch (ApiException e) {
              Log.w(TAG, "Google sign in failed", e);
          }
      }
  }
  
  private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
      Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
      AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
      mAuth.signInWithCredential(credential)
              .addOnCompleteListener(this, new OnCompleteListener&lt;AuthResult&gt;() {
  
                  @Override
                  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                      if (task.isSuccessful()) {
                          FirebaseUser user = mAuth.getCurrentUser();
                      }
                  }
              });
  }
  private void signIn() {
      Intent signInIntent = mGoogleSignInClient.getSignInIntent();
      startActivityForResult(signInIntent, RC_SIGN_IN);
  }
  
  @Override
  public void onClick(View v) {
  }
  }
  </code></pre>
  
  <p>how to fix this?<br>
  am I missing something?<br>
  guidances would be appreciated.</p>