Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.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 需要Firebase getCurrentUser方法说明_Android_Firebase_Firebase Authentication - Fatal编程技术网

Android 需要Firebase getCurrentUser方法说明

Android 需要Firebase getCurrentUser方法说明,android,firebase,firebase-authentication,Android,Firebase,Firebase Authentication,有谁能告诉我,让当前用户做什么 private ProgressDialog progressDialog; private FirebaseAuth firebaseAuth; progressDialog = new ProgressDialog(this); firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null){ //start profil

有谁能告诉我,让当前用户做什么

private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
progressDialog = new ProgressDialog(this);
    firebaseAuth = FirebaseAuth.getInstance();
    if (firebaseAuth.getCurrentUser() != null){
        //start profile activity
        finish();
        startActivity(new Intent(getApplicationContext(),Profile.class));
    }

我不清楚哪个用户获得当前用户选择?

FirebaseAuth.getInstance.getCurrentUser返回firebase中当前登录的用户。您从android emulator登录时所使用凭据的用户。如果用户未登录,getCurrentUser返回null。

firebaseAuth.getCurrentUser用于获取FirebaseUser对象,该对象包含有关登录用户的信息。 如果返回null,则用户尚未登录,否则将重定向到上面代码中的Profile.class