diff --git a/app/src/main/java/com/example/sprout/refactor/viewmodel/RegistrationViewModel.java b/app/src/main/java/com/example/sprout/refactor/viewmodel/RegistrationViewModel.java index c997275..dda7303 100644 --- a/app/src/main/java/com/example/sprout/refactor/viewmodel/RegistrationViewModel.java +++ b/app/src/main/java/com/example/sprout/refactor/viewmodel/RegistrationViewModel.java @@ -40,7 +40,6 @@ } }; - registrationRepository.getAccountObservable().addObserver(observer); } @Override @@ -53,8 +52,14 @@ } @Override - public void onDestroy() { - super.onDestroy(); + public void onResume() { + super.onResume(); + registrationRepository.getAccountObservable().addObserver(observer); + } + + @Override + public void onPause() { + super.onPause(); registrationRepository.getAccountObservable().removeObserver(observer); }