Fixed handling compose pause

pull/72/head
M66B 6 years ago
parent aab40f78c0
commit d1af6fa853

@ -352,19 +352,29 @@ public class FragmentCompose extends FragmentEx {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
if (savedInstanceState == null) { if (savedInstanceState == null) {
Bundle args = new Bundle(); if (working < 0) {
args.putString("action", getArguments().getString("action")); Bundle args = new Bundle();
args.putLong("id", getArguments().getLong("id", -1)); args.putString("action", getArguments().getString("action"));
args.putLong("account", getArguments().getLong("account", -1)); args.putLong("id", getArguments().getLong("id", -1));
args.putLong("reference", getArguments().getLong("reference", -1)); args.putLong("account", getArguments().getLong("account", -1));
args.putLong("answer", getArguments().getLong("answer", -1)); args.putLong("reference", getArguments().getLong("reference", -1));
args.putString("to", getArguments().getString("to")); args.putLong("answer", getArguments().getLong("answer", -1));
args.putString("cc", getArguments().getString("cc")); args.putString("to", getArguments().getString("to"));
args.putString("bcc", getArguments().getString("bcc")); args.putString("cc", getArguments().getString("cc"));
args.putString("subject", getArguments().getString("subject")); args.putString("bcc", getArguments().getString("bcc"));
args.putString("body", getArguments().getString("body")); args.putString("subject", getArguments().getString("subject"));
args.putParcelableArrayList("attachments", getArguments().getParcelableArrayList("attachments")); args.putString("body", getArguments().getString("body"));
draftLoader.load(this, args); args.putParcelableArrayList("attachments", getArguments().getParcelableArrayList("attachments"));
draftLoader.load(this, args);
} else {
Bundle args = new Bundle();
args.putString("action", "edit");
args.putLong("id", working);
args.putLong("account", -1);
args.putLong("reference", -1);
args.putLong("answer", -1);
draftLoader.load(this, args);
}
} else { } else {
encrypted = savedInstanceState.getString("encrypted"); encrypted = savedInstanceState.getString("encrypted");

@ -54,13 +54,14 @@ public class FragmentEx extends Fragment {
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
Log.i(Helper.TAG, "Save instance " + this);
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
outState.putString("subtitle", subtitle); outState.putString("subtitle", subtitle);
} }
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Log.i(Helper.TAG, "Create " + this); Log.i(Helper.TAG, "Create " + this + " saved=" + (savedInstanceState != null));
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (savedInstanceState != null) if (savedInstanceState != null)
subtitle = savedInstanceState.getString("subtitle"); subtitle = savedInstanceState.getString("subtitle");
@ -74,7 +75,7 @@ public class FragmentEx extends Fragment {
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
Log.i(Helper.TAG, "Activity " + this); Log.i(Helper.TAG, "Activity " + this + " saved=" + (savedInstanceState != null));
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
} }

Loading…
Cancel
Save