Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 通过FirebaseUI进行签名时,如何识别用户是否是新用户?_Android_Firebase Authentication_Firebaseui - Fatal编程技术网

Android 通过FirebaseUI进行签名时,如何识别用户是否是新用户?

Android 通过FirebaseUI进行签名时,如何识别用户是否是新用户?,android,firebase-authentication,firebaseui,Android,Firebase Authentication,Firebaseui,在使用FirebaseUI时如何使用AdditionalUserInfo.isNewUser(),或者在用户登录后是否需要对数据库进行查询。 下面是一些代码,我想从中获取这些信息- @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requ

在使用FirebaseUI时如何使用AdditionalUserInfo.isNewUser(),或者在用户登录后是否需要对数据库进行查询。 下面是一些代码,我想从中获取这些信息-

 @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == RC_SIGN_IN) {
        IdpResponse response = IdpResponse.fromResultIntent(data);

        // Successfully signed in

        if (resultCode == RESULT_OK) {
// here i want to know if user is new???????????????????????????
            finish();
            startActivity(getIntent());
            overridePendingTransition(0, 0);
        } else {
            // Sign in failed
            if (response == null) {
                // User pressed back button
                showSnackbar(R.string.sign_in_cancelled);
                return;
            }

            if (response.getError().getErrorCode() == ErrorCodes.NO_NETWORK) {
                showSnackbar(R.string.no_internet_connection);
                return;
            }

            showSnackbar(R.string.unknown_error);
            Log.e(TAG, "Sign-in error: ", response.getError());
        }
    }
?