Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e095ceaa authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Handle returning a result from automatic up navigation from another task." into jb-dev

parents 7a59c5ae 3d193d92
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2713,7 +2713,16 @@ public class Activity extends ContextThemeWrapper
                onCreateNavigateUpTaskStack(b);
                onPrepareNavigateUpTaskStack(b);
                b.startActivities();

                // We can't finishAffinity if we have a result.
                // Fall back and simply finish the current activity instead.
                if (mResultCode != RESULT_CANCELED || mResultData != null) {
                    // Tell the developer what's going on to avoid hair-pulling.
                    Log.i(TAG, "onNavigateUp only finishing topmost activity to return a result");
                    finish();
                } else {
                    finishAffinity();
                }
            } else {
                navigateUpTo(upIntent);
            }