Status Update
Comments
jb...@google.com <jb...@google.com> #2
Please include a sample project that reproduces your issue.
ka...@droidsonroids.pl <ka...@droidsonroids.pl> #3
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> #4
ma...@marcardar.com <ma...@marcardar.com> #5
il...@google.com <il...@google.com> #6
ha...@gmail.com <ha...@gmail.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?
il...@google.com <il...@google.com> #8
w....@futuremind.com <w....@futuremind.com> #9
Any idea on when it will be fixed?
hu...@gmail.com <hu...@gmail.com> #10
ka...@live.com <ka...@live.com> #11
Can you update regarding any progress on this issue.
ka...@live.com <ka...@live.com> #13
Branch: androidx-main
commit 50f098644adc703ae218b0b7e999629f516a0241
Author: sanura <sanura@google.com>
Date: Thu Mar 02 00:11:35 2023
Add check to only invalidate options menu when contributing menu items
FragmentManager previously appropriately only added
a MenuProvider when the host is a MenuHost **and**
we are at the root fragment that is providing the
menu items. This behavior should be mirrored when
removing a MenuProvider as well, so that only
components that directly contribute menu items will
invalidate the options menu.
Bug: 244336571
Test: all tests pass
Change-Id: I9404ee9fcc9ce6b80d70a93bea720fe4ccf583a0
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerInflatedFragmentTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/OptionsMenuFragmentTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/test/FragmentTestActivity.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
hu...@gmail.com <hu...@gmail.com> #14
Please show what to write on gradle file.
il...@google.com <il...@google.com> #15
This has been fixed internally and will be available in the Fragment 1.6.0-alpha07
release.
ka...@live.com <ka...@live.com> #16
It's part of the material dependency, perhaps?
hu...@gmail.com <hu...@gmail.com> #17
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.6.0-alpha07
ro...@gmail.com <ro...@gmail.com> #18
ru...@gmail.com <ru...@gmail.com> #19
It says "Duplicate class found".
The IDE doesn't provide any useful explanation of what is the class that is duplicated and what to do about it.
Please help.
lu...@lloydsbanking.com <lu...@lloydsbanking.com> #20
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.5.6
ka...@droidsonroids.pl <ka...@droidsonroids.pl> #21
da...@gmail.com <da...@gmail.com> #22
@21 androidx.fragment:fragment:1.5.6 is a STABLE release. It has the fix we need. The androidx.fragment:fragment:1.6.0-alpha07 is an alpha as it says. 1.6 is "work in progress". 1.6.0 is still not a stable release. Use "alpha" only for testing
ma...@americium.org <ma...@americium.org> #23
mo...@gmail.com <mo...@gmail.com> #25
This is the updated answer.
[Deleted User] <[Deleted User]> #26
sp...@gmail.com <sp...@gmail.com> #27
Just ran into this today and I am sad that this is marked as "infeasible" when a good response to this problem, at minimum, is to update the boilerplate code for new projects so that it doesn't generate code that automatically gets complaints from lint and then auto-fixes to broken code.
na...@gmail.com <na...@gmail.com> #28
this seems working but handler is deprecated is showing
ps: Im using nav-frag 2.7+ and viewbinding so first method is also not working
Description
Version used: 1.2.0-beta02
Devices/Android versions reproduced on: all
When the NavHostFragment is inflated using FragmentContainerView, if you attempt to use findNavController in the onCreate() of the Activity, the nav controller cannot be found. This is because when the fragment is inflated in the constructor of FragmentContainerView, the fragmentManager is in the INITIALIZING state, and therefore the added fragment only goes up to initializing. For the nav controller to be properly set, the fragment view needs to be created and onViewCreated() needs to be dispatched, which does not happen until the ACTIVITY_CREATED state.
We should either force the fragment to create a view right after being added to the FragmentManager, or find a way to wait for the FragmentManager to reach a higher state before allowing the Navigation onCreate to be called.
The following options can be used as viable work arounds:
1. Retrieve the navController directly from the NavHostFragment.
val navHostFragment = supportFragmentManager.findFragmentById(R.id.my_nav_host_fragment) as NavHostFragment
val navController = navHostFragment.navController
2. Post the call to the findNavController method on a handler and execute all actions that need it after that post is complete.
3. Continue to use the fragment tag (<fragment>) to inflate the NavHostFragment