diff --git a/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java b/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java index ae65759..6301b5d 100644 --- a/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java +++ b/app/src/main/java/com/example/nemophila/MyPageEditorActivity.java @@ -23,7 +23,7 @@ super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_page_editor); - //AccountViewModelとの通信 + //LiveDataへの購読 AccountViewModel accountViewModel = new ViewModelProvider(this).get(AccountViewModel.class); Nemophila nemophila = (Nemophila) getApplication(); String name = nemophila.getName(); @@ -38,18 +38,17 @@ startActivity(intent); } }); - + //LiveDataへの購読 accountViewModel.getNameLiveData().observe(this, new Observer() { @Override public void onChanged(String name) { TextView myName = (TextView) findViewById(R.id.editName); myName.setText(name); nemophila.setName(name); -// Intent intent = new Intent(MyPageEditorActivity.this, MyPageActivity.class); -// startActivity(intent); } }); + //LiveDataへの購読 accountViewModel.getPwLiveData().observe(this, new Observer() { @Override public void onChanged(String Pw) { @@ -58,6 +57,7 @@ } }); + //LiveDataへの購読 accountViewModel.getPwErrorLiveData().observe(this, new Observer() { @Override public void onChanged(String name) {