Fixed
Status Update
Comments
ku...@google.com <ku...@google.com>
ku...@google.com <ku...@google.com> #2
Please include a sample project that reproduces your issue.
ku...@google.com <ku...@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?
ku...@google.com <ku...@google.com> #4
Hello, have you checked sample project? I hope it will help find the issue.
sm...@gmail.com <sm...@gmail.com> #5
sm...@gmail.com <sm...@gmail.com> #6
Hello, any update please?
sm...@gmail.com <sm...@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?
af...@gmail.com <af...@gmail.com> #9
Hi, i am also facing this issue after we dismiss a DialogFragment, the callback comes in the onPrepareOptionsMenu(), which is causing the issues for me.
Any idea on when it will be fixed?
Any idea on when it will be fixed?
jp...@gmail.com <jp...@gmail.com> #10
Hello, any estimate please?
il...@google.com <il...@google.com>
an...@google.com <an...@google.com> #11
Facing a similar kind of issue when scrolling the fragments using a ViewPager.
https://issuetracker.google.com/issues/267677504
Can you update regarding any progress on this issue.
Can you update regarding any progress on this issue.
ap...@google.com <ap...@google.com> #12
jb...@google.com <jb...@google.com> #13
Project: platform/frameworks/support
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
https://android-review.googlesource.com/2465169
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
Description
Please describe the problem in detail. Be sure to include:
- Steps to reproduce the problem (including sample code if appropriate).
Subclass androidx.fragment.app.DialogFragment and in onCreateDialog get an instance of the layout inflater using getLayoutInflater.
compileSdkVersion 28
minSdkVersion 23
targetSdkVersion 28
import android.app.AlertDialog
import android.app.Dialog
import android.os.Bundle
import androidx.fragment.app.DialogFragment
class AddUserDialogFragment : DialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val inflater = layoutInflater // this throws a stack overflow error
val view = inflater.inflate(R.layout.fragment_add_user, null)
return AlertDialog.Builder(activity!!)
.setTitle(R.string.some_title)
.setView(view)
.setPositiveButton(R.string.add, null)
.setNegativeButton(R.string.cancel) { dialog, which ->
}
.create()
}
}
- What happened.
The call to getLayoutInflater stack overflows
2018-10-18 06:55:31.279 20850-20850/? E/AndroidRuntime: at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at androidx.fragment.app.Fragment.getLayoutInflater(Fragment.java:1293)
at com.ase.solutions.mat.organization.adduser.AddUserDialogFragment.onCreateDialog(AddUserDialogFragment.kt:26)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:330)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at androidx.fragment.app.Fragment.getLayoutInflater(Fragment.java:1293)
at com.ase.solutions.mat.organization.adduser.AddUserDialogFragment.onCreateDialog(AddUserDialogFragment.kt:26)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:330)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at androidx.fragment.app.Fragment.getLayoutInflater(Fragment.java:1293)
.. further down ...
2018-10-18 06:55:31.279 20850-20850/? E/AndroidRuntime: at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at com.ase.solutions.mat.organization.adduser.AddUserDialogFragment.onCreateDialog(AddUserDialogFragment.kt:26)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:330)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at androidx.fragment.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
- What you think the correct behavior should be.
It should return a layout inflater
Don't forget to mention which version of Android you're using, and/or which
device the problem appears on (model and Android version).
API 28
Please also run "adb bugreport" and archive the output.