私はAndroidアプリ開発でかなり新しいです、私は、ユーザーがデータベースにサインアップすることができ、そこから活動をしようとしています、これはコードFirebaseユーザーregisteration
public class RegisterActivity extends AppCompatActivity {
TextInputLayout mEmail, mPassword;
Button mRegisterButton;
FirebaseAuth mAuth;
Button loginAccountButton;
ProgressDialog progressDialogue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
mPassword = (TextInputLayout) findViewById(R.id.password);
mEmail = (TextInputLayout) findViewById(R.id.email);
loginAccountButton = (Button) findViewById(R.id.loginalready);
mRegisterButton = (Button) findViewById(R.id.registerButton);
progressDialogue = new ProgressDialog(RegisterActivity.this);
mAuth = FirebaseAuth.getInstance();
loginAccountButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(RegisterActivity.this,login.class));
}
});
mRegisterButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
registeruser();
}
private void registeruser() {
String email = mEmail.getEditText().getText().toString().trim();
String password = mPassword.getEditText().getText().toString().trim();
progressDialogue.setMessage("Please wait");
progressDialogue.show();
mAuth.createUserWithEmailAndPassword(email,password)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
progressDialogue.dismiss();
Toast.makeText(RegisterActivity.this,"You're now registered",Toast.LENGTH_LONG).show();
startActivity(new Intent(RegisterActivity.this,MainActivity.class));
finish();
}
else{
Toast.makeText(RegisterActivity.this,"Something went horribly wrong",Toast.LENGTH_LONG).show();
}
}
});
}
});
}}
あるすべてのクラスが適切にインポートされ、その周りに方法がないように思える、コードは数時間前に働いていたが、今それはちょうど私がしようとするたびにびくともし、それはトースト何かが
this is the activity_register.xml
<android.support.design.widget.TextInputLayout
android:layout_width="368dp"
android:layout_height="wrap_content"
android:id="@+id/email"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
tools:layout_editor_absoluteY="8dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="EMAIL" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="368dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/email"
android:id="@+id/password"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="PASSWORD" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/registerButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:text="REGISTER"
app:layout_constraintTop_toBottomOf="@+id/password"
tools:layout_editor_absoluteX="280dp" />
<Button
android:id="@+id/loginalready"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:text="login"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:text="login?"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/password"
app:layout_constraintVertical_bias="0.051" />
ログを貼り付けることはできますか? – ashish
トーストtask.error –
あなたのインターネット接続を確認してください –