Status Update
Comments
ap...@google.com <ap...@google.com> #2
I am not sure I understand what you are asking for here.
The contract of onPrepareMenu
in MenuProvider
is:
"Called by the MenuHost right before the Menu is shown. This should be called when the menu has been dynamically updated."
If you were using Toolbar
prior to the MenuHost
integration, this should be a no-op for you. And if you are now switching to Toolbar, the onPrepareMenu()
call should be in the proper place.
But the contract is not being violated.
If you are seeing some unexpected behavior, please provide a sample app that reproduces the error that you are observing.
na...@google.com <na...@google.com> #3
reuploading my previous sample app.
It's fairly simple.
Call order with AppCompat 1.5.0-alpha01:
- onCreateMenu
- onPrepareMenu
- user opens menu
- menu is displayed
According to the contract:
"Called by the MenuHost right before the Menu is shown.
it should be:
- onCreateMenu
- user opens menu
- onPrepareMenu
- menu is displayed
build and run the sample. It has examples for both activity and fragment. Follow the print out's in the log.
Description
Component used: Macrobench 1.3.0-SNAPSHOT
Sorry, should've found this in the aosp/2853596 .
I think the
label
param should be after themode
param, because it forces usingmode
with named argument, or needs to be defined.I suggest putting the
label
as the last argument, because it's the least likely to be defined.