2

我的 android 程序 Firebase Login-Register 屏幕的 createUserWithEmailAndPassword 方法不起作用。

public void btnUserkayit_Click(View view) {
    final ProgressDialog progressDialog = ProgressDialog.show(RegisterActivity.this, "Lütfen Bekleyiniz...", "Kayıt yapılıyor...", true);
    (firebaseAuth.createUserWithEmailAndPassword(txtEmail.getText().toString(), txtPass.getText().toString()))
            .addOnCompleteListener(RegisterActivity.this,new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    progressDialog.dismiss();
                    if (task.isSuccessful()) {
                        Toast.makeText(RegisterActivity.this, "Kaydınız oluşturulmuştur", Toast.LENGTH_LONG).show();
                        Intent i = new Intent(RegisterActivity.this, LoginActivity.class);
                        startActivity(i);
                    } else {
                        Log.e("ERROR",task.getException().toString());
                        Toast.makeText(RegisterActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
                    }
                }

            });
}

我单击“注册”按钮,Progressdialog 显示在屏幕中,但不会随时隐藏。请帮我。我尝试了互联网上的所有方法,但没有用。

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
testCompile 'junit:junit:4.12'

}

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.2'
    classpath 'com.google.gms:google-services:3.1.0'        // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

4

0 回答 0