小编Sam*_*Sam的帖子

在Android注销后重新登录Google时出错

嗨我在我的应用程序中使用谷歌登录它工作正常,但每当我退出时我尝试了许多解决方案注销但它不适用于我,如果我进一步点击谷歌登录按钮然后应用程序崩溃.

这是我的登录代码

public class LoginActivity extends Activity implements AsyncInterface,
    OnClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {

EditText etLoginEmail, etLoginPassword;
Button btnLoginSubmit, btnLoginSignup;
TextView txtLoginForgotPass;

LoginResponseMain loginResponseMain;

/* For Google */
private static final int RC_SIGN_IN = 0;
private GoogleApiClient mGoogleApiClient;
private boolean mIntentInProgress;
private boolean mSignInClicked;
private ConnectionResult mConnectionResult;
private SignInButton btnSignIn;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    init();

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this).addApi(Plus.API)
            .addScope(Plus.SCOPE_PLUS_LOGIN).build();

    // Google Sign In Button        
    btnSignIn.setOnClickListener(this);
}

@Override
protected void onStart() {
    super.onStart();
    if (AppMethod.getBooleanPreference(LoginActivity.this, …
Run Code Online (Sandbox Code Playgroud)

android google-login

6
推荐指数
1
解决办法
308
查看次数

标签 统计

android ×1

google-login ×1