mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-05 12:24:26 +01:00
Moved observers and loaders to onActivityCreate
This commit is contained in:
@@ -188,6 +188,17 @@ public class FragmentAccount extends FragmentEx {
|
||||
pbCheck.setVisibility(View.GONE);
|
||||
ibDelete.setVisibility(id < 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
// Get arguments
|
||||
Bundle args = getArguments();
|
||||
long id = (args == null ? -1 : args.getLong("id", -1));
|
||||
|
||||
// Observe
|
||||
DB.getInstance(getContext()).account().liveAccount(id).observe(this, new Observer<EntityAccount>() {
|
||||
@Override
|
||||
@@ -202,8 +213,6 @@ public class FragmentAccount extends FragmentEx {
|
||||
cbPrimary.setEnabled(account == null ? true : account.synchronize);
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private static class PutLoader extends AsyncTaskLoader<Throwable> {
|
||||
|
||||
Reference in New Issue
Block a user