Skip to content

Commit

Permalink
Fix having a duplicate view task screen after and edit. #379 (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabor Keszthelyi authored and dmfs committed Jul 26, 2017
1 parent 71630d4 commit 0db3ab0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 0db3ab0

Please sign in to comment.