From 0db3ab0d12ccf803249b71c9e29144b8d9fa8dbd Mon Sep 17 00:00:00 2001 From: Gabor Keszthelyi Date: Wed, 26 Jul 2017 11:59:15 +0200 Subject: [PATCH] Fix having a duplicate view task screen after and edit. #379 (#381) --- .../src/main/java/org/dmfs/tasks/EditTaskFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java b/opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java index f26304be3..6f56e177d 100644 --- a/opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java +++ b/opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java @@ -743,6 +743,8 @@ public void saveAndExit() // TODO: put that in a background task Activity activity = getActivity(); + boolean isNewTask = mValues.isInsert(); + if (mEditor != null) { mEditor.updateValues(); @@ -805,7 +807,10 @@ public void saveAndExit() activity.setResult(Activity.RESULT_OK, new Intent().setData(mTaskUri)); Toast.makeText(activity, R.string.activity_edit_task_task_saved, Toast.LENGTH_SHORT).show(); activity.finish(); - activity.startActivity(new Intent("android.intent.action.VIEW", mTaskUri)); + if (isNewTask) + { + activity.startActivity(new Intent("android.intent.action.VIEW", mTaskUri)); + } } else {