From 581e6eb50beaa90c80615a40ca2a687f1c345246 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 4 Aug 2018 14:57:36 +0000 Subject: [PATCH] Fixed lifecycle owners --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 2 +- app/src/main/java/eu/faircode/email/FragmentSetup.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 86c4032b..b2ff92c6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -182,7 +182,7 @@ public class FragmentCompose extends Fragment { bottom_navigation.getMenu().findItem(R.id.action_delete).setVisible(id > 0); bottom_navigation.getMenu().setGroupEnabled(0, false); - DB.getInstance(getContext()).identity().liveIdentities(true).observe(getActivity(), new Observer>() { + DB.getInstance(getContext()).identity().liveIdentities(true).observe(FragmentCompose.this, new Observer>() { @Override public void onChanged(@Nullable final List identities) { Collections.sort(identities, new Comparator() { diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index 0028f2f2..8f50183c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -82,7 +82,7 @@ public class FragmentSetup extends Fragment { btnAccount.setEnabled(false); pbAccount.setVisibility(View.VISIBLE); - DB.getInstance(getContext()).account().liveFirstAccount().observe(getActivity(), new Observer() { + DB.getInstance(getContext()).account().liveFirstAccount().observe(FragmentSetup.this, new Observer() { @Override public void onChanged(@Nullable EntityAccount account) { btnAccount.setEnabled(true); @@ -116,7 +116,7 @@ public class FragmentSetup extends Fragment { btnIdentity.setEnabled(false); pbIdentity.setVisibility(View.VISIBLE); - DB.getInstance(getContext()).identity().liveFirstIdentity().observe(getActivity(), new Observer() { + DB.getInstance(getContext()).identity().liveFirstIdentity().observe(FragmentSetup.this, new Observer() { @Override public void onChanged(@Nullable EntityIdentity identity) { btnIdentity.setEnabled(true);