Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Please include a sample project that reproduces your issue.
ha...@gmail.com <ha...@gmail.com>
il...@google.com <il...@google.com> #3
Here is the sample project.
Steps to reproduce:
1. Press on "Search" icon;
2. Write something;
3. Search this text, keyboard will be dismissed;
4. Tap on "Dialog" button;
5. Dissmiss dialog;
With the new 1.5.0 fragment library version text will be cleared in the search box after dismissing dialog.
In the version 1.4.1 and lower text in the search is not clearing and this is correct behaviour.
Please suggest some workarounds or how to fix this issue?
Steps to reproduce:
1. Press on "Search" icon;
2. Write something;
3. Search this text, keyboard will be dismissed;
4. Tap on "Dialog" button;
5. Dissmiss dialog;
With the new 1.5.0 fragment library version text will be cleared in the search box after dismissing dialog.
In the version 1.4.1 and lower text in the search is not clearing and this is correct behaviour.
Please suggest some workarounds or how to fix this issue?
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #4
Hello, have you checked sample project? I hope it will help find the issue.
il...@google.com <il...@google.com> #5
an...@google.com <an...@google.com> #6
Hello, any update please?
il...@google.com <il...@google.com> #7
Hello
I raised similar issue with this ticket
This makes the SearchView unusable/broken when fragments are changed (i.e base on searchView input query)
What can we do to fix this problem? What is the progress of work on solving this problem?
Description
Version used: 1.1.0-beta01
For any given fragment backstack, if the fragment to be popped off the backstack is the current primary navigation fragment, this results in a NullPointerException on that popped fragment's FragmentManager receiving notification that the primary navigation fragment changed. Because that fragment is being removed, it no longer has a host nor a reference to that host's FragmentManager. Specifically, this happens at androidx.fragment.app.Fragment.performPrimaryNavigationFragmentChanged, line 2662 (mFragmentManager is null).
Example:
fragmentManager.beginTransaction()
.add(containerId, FragmentA())
.commit()
Current backstack:
A (not primary)
Transaction adding a new fragment that is to be a primary nav fragment:
val fragmentB = FragmentB()
fragmentManager.beginTransaction()
.addToBackStack(null)
.setPrimaryNavigationFragment(fragmentB)
.replace(containerId, fragmentB)
.commit()
Current backstack:
A -> B (primary)
If activity.onBackPress() or fragmentManager.popBackStack() is called, as B is being popped, the FragmentManager's primary nav fragment is set to null, and B (that is now removed) notifies its host FragmentManager of this change (which B no longer has a host because it was removed).