onPrepareActionMenu

abstract fun onPrepareActionMenu(@NonNull actionMenu: ActionMenu): Boolean

Called when action menu is being prepared. This is called right before the menu is shown, every time it is shown. You can use this method to add new items or otherwise dynamically modify the contents.