Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix having a duplicate view task screen after and edit. #379 #381

Merged
merged 1 commit into from
Jul 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions opentasks/src/main/java/org/dmfs/tasks/EditTaskFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public void onContentLoaded(ContentSet contentSet)
}

/*
* Don't start the model loader here, let onItemSelected do that.
* Don't start the model loader here, let onItemSelected do that.
*/
setListUri(TaskLists.getContentUri(mAuthority), LIST_LOADER_VISIBLE_LISTS_FILTER);
}
Expand Down Expand Up @@ -742,6 +742,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 @@ -804,7 +806,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