mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-30 01:21:11 +01:00
Save fragment instance states
This commit is contained in:
@@ -258,11 +258,18 @@ public class FragmentCompose extends FragmentEx {
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (autosave)
|
||||
onAction(R.id.action_save);
|
||||
outState.putLong("working", working);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if (working < 0) {
|
||||
if (savedInstanceState == null) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("action", getArguments().getString("action"));
|
||||
args.putLong("id", getArguments().getLong("id", -1));
|
||||
@@ -272,7 +279,7 @@ public class FragmentCompose extends FragmentEx {
|
||||
} else {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("action", "edit");
|
||||
args.putLong("id", working);
|
||||
args.putLong("id", savedInstanceState.getLong("working"));
|
||||
args.putLong("account", -1);
|
||||
args.putLong("reference", -1);
|
||||
draftLoader.load(this, args);
|
||||
|
||||
Reference in New Issue
Block a user