diff --git a/app/src/main/java/com/example/sprout/refactor/model/RegistrationModel.java b/app/src/main/java/com/example/sprout/refactor/model/RegistrationModel.java index a9f1d7f..e12c427 100644 --- a/app/src/main/java/com/example/sprout/refactor/model/RegistrationModel.java +++ b/app/src/main/java/com/example/sprout/refactor/model/RegistrationModel.java @@ -15,12 +15,14 @@ private Observer observer = null; private Observable accountObservable = new Observable<>(); private RegistrationRepository registrationRepository = null; + private Account account = null; public RegistrationModel(RegistrationRepository registrationRepository) { this.registrationRepository = registrationRepository; observer = new Observer() { @Override public void notify(Account account) { + RegistrationModel.this.account = account; PreferenceUtil.getInstance().saveInt(PreferenceUtil.Key.USER_ID, account.getUserID()); PreferenceUtil.getInstance().saveBoolean(PreferenceUtil.Key.REGISTERED, true); accountObservable.notifyObservers(account); @@ -42,4 +44,8 @@ public Observable getAccountObservable() { return accountObservable; } + + public Account getAccount(){ + return this.account; + } }