-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fragment's menu not localized on rotation #20
Comments
Unfortunately, I can't reproduce it across different android versions on emulator and my Pixel2 using your sample project. |
Ok, lets add more steps to reproduce :) Environment:
Steps:
Expected result:
Actual result:
Note: |
Okay, just reproduced it. It's important to keep the menu open before rotating the device to replicate the issue. Will dive deeper and see what I can do. Thank you for reporting! |
Well, there are more cases when this can happen. Not only when menu is kept opened, but when you open/close navigation drawer and some other. But they require much more code for testing. Unfortunately, only option I've used to solve this is manually set title for each menu item in onPrepareOptionsMenu. |
Steps to reproduce:
If you add something like this:
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
menu.clear()
MenuInflater(activity?.applicationContext).let {
it.inflate(R.menu.main_menu, menu)
super.onPrepareOptionsMenu(menu)
}
}
it solves problem, but adds new one -
app:showAsAction="always"
is ignoredI've created fork to test this out and maybe add some fixes if have any, but no luck.
If you want sample, please check https://github.com/RumataEstorish/lingver/tree/fragment_menu_test
The text was updated successfully, but these errors were encountered: