Android Firebase createUserWithEmailAndPassword方法无法进入

时间:2017-06-16 18:47:06

标签: android firebase createuser

我的Android程序Firebase登录 - 注册屏幕的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
}

}

0 个答案:

没有答案