firebase ui电话身份验证无法正常工作

时间:2019-03-23 11:52:33

标签: android

我正在尝试使用firebase-ui-auth库添加电话认证。用户成功登录后,首先在(onActivityResult)方法中,添加了一个将用户带到MainActivity的Intent。但是后来我想将MainActivity更改为另一个不起作用的Activity,仍然将用户带到MainActivity!甚至我将另一个活动传递给了Intent而不是MainActivity!

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    // RC_SIGN_IN is the request code you passed into startActivityForResult(...) when starting the sign in flow.
    if (requestCode == RC_SIGN_IN) {
        IdpResponse response = IdpResponse.fromResultIntent(data);

        // Successfully signed in
        if (resultCode == RESULT_OK) {
           FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
            Intent intent = new Intent(SplashActivity.this, MainActivity.class);
            startActivity(intent);
            finish();



        } else {// show a massage
            }

}}

0 个答案:

没有答案