Исходный код Android
Проверьте метод "ActivityStarter.computeLaunchingTaskFlags ()":
} else if (mSourceRecord.launchMode == LAUNCH_SINGLE_INSTANCE) {
// The original activity who is starting us is running as a single
// instance... this new activity it is starting must go on its
// own task.
mLaunchFlags |= FLAG_ACTIVITY_NEW_TASK;
Именно по этой причине флаг NEW_TASK добавляется при исходной активности в режиме запуска одного экземпляра.
Больше исходного кода
Проверка метода "ActivityStarter.sendNewTaskResultRequestIfNeeded ()":
if (sourceStack != null && (mLaunchFlags & FLAG_ACTIVITY_NEW_TASK) != 0) {
// For whatever reason this activity is being launched into a new task...
// yet the caller has requested a result back. Well, that is pretty messed up,
// so instead immediately send back a cancel and let the new task continue launched
// as normal without a dependency on its originator.
Slog.w(TAG, "Activity is launching as a new task, so cancelling activity result.");
sourceStack.sendActivityResultLocked(-1 /* callingUid */, mStartActivity.resultTo,
mStartActivity.resultWho, mStartActivity.requestCode, RESULT_CANCELED,
null /* data */);
Именно поэтому FLAG_ACTIVITY_NEW_TASK всегда немедленно возвращает RESULT_CANCELED.