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

onFragmentResult没有执行 #57

Open
AndersonCodeArt opened this issue Aug 3, 2024 · 1 comment
Open

onFragmentResult没有执行 #57

AndersonCodeArt opened this issue Aug 3, 2024 · 1 comment

Comments

@AndersonCodeArt
Copy link

使用库版本:7.3.0, 因为当时是直接下载到本地做了修改, 现在忘记了修改哪些内容,所以一直没有升级..

在FragmentA执行代码跳转FragmentB:
NavigationFragment fragment = new NavigationFragment();
fragment.setRootFragment(new FragmentB(position, list));
presentFragment(fragment, 123);

在FragmentB中执行:
Bundle result = new Bundle();
result.putSerializable("tests", "1243");
setResult(Activity.RESULT_OK, result);
dismissFragment();

然后再FramentA中的onFragmentResult方法并未执行. FragmentA中也重写了onActivityResult不知道是否有影响, 不过以上操作onActivityResult内也未执行.

烦请大佬给个思路

@AndersonCodeArt
Copy link
Author

重新测试了一下, 新建了一个FragmentC, 直接FragmentA present FragmentC, 没有包裹NavicationFragment, 结果一样onFragmentResult未执行.

FragmentA是Viewpager2中的一页,在FragmentStateAdapter中new出来的.

继续寻找问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant