Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
weikaiyun committed Sep 15, 2020
1 parent 9f7fd52 commit 155c17e
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,21 @@ boolean dispatchBackPressedEvent(ISupportFragment activeFragment) {
}

void handleResultRecord(Fragment from) {
Bundle args = from.getArguments();
if (args == null) return;
final ResultRecord resultRecord = args.getParcelable(FRAGMENTATION_ARG_RESULT_RECORD);
if (resultRecord == null) return;

ISupportFragment targetFragment = (ISupportFragment) from
.getParentFragmentManager()
.getFragment(from.getArguments(), FRAGMENTATION_STATE_SAVE_RESULT);

if (targetFragment == null) return;
targetFragment.onFragmentResult(resultRecord.requestCode, resultRecord.resultCode, resultRecord.resultBundle);
try {
Bundle args = from.getArguments();
if (args == null) return;
final ResultRecord resultRecord = args.getParcelable(FRAGMENTATION_ARG_RESULT_RECORD);
if (resultRecord == null) return;

ISupportFragment targetFragment = (ISupportFragment) from
.getParentFragmentManager()
.getFragment(from.getArguments(), FRAGMENTATION_STATE_SAVE_RESULT);

if (targetFragment == null) return;
targetFragment.onFragmentResult(resultRecord.requestCode, resultRecord.resultCode, resultRecord.resultBundle);
} catch (IllegalStateException ignored) {
// Fragment no longer exists
}
}

private void enqueue(FragmentManager fm, Action action) {
Expand Down

0 comments on commit 155c17e

Please sign in to comment.