diff --git a/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java b/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java index 21bb79e..ae65759 100644 --- a/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java +++ b/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java @@ -6,10 +6,12 @@ import android.content.Intent; import android.os.Bundle; +import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; +import android.widget.Toast; import com.example.nemophila.entities.Account; import com.example.nemophila.viewmodels.AccountViewModel; @@ -43,8 +45,8 @@ TextView myName = (TextView) findViewById(R.id.editName); myName.setText(name); nemophila.setName(name); - Intent intent = new Intent(MyPageEditorActivity.this, MyPageActivity.class); - startActivity(intent); +// Intent intent = new Intent(MyPageEditorActivity.this, MyPageActivity.class); +// startActivity(intent); } }); @@ -56,6 +58,15 @@ } }); + accountViewModel.getPwErrorLiveData().observe(this, new Observer() { + @Override + public void onChanged(String name) { + Toast ts = Toast.makeText(MyPageEditorActivity.this, "パスワードが間違っています", Toast.LENGTH_SHORT); + ts.setGravity(Gravity.CENTER, 0, 0); + ts.show(); + } + + }); //変更確定ボタンを押した場合の動き Button changeNameButton = (Button) findViewById(R.id.changeConfirm);