Issue
in actionbar home fragment bottomnavigation
in action bar favorite fragment bottomnavigation
how to hide or remove actionbar icon when moving to favorite fragment?
Solution
You just need to make your FavoriteFragment
options menu aware and then in onCreateOptionsMenu
, simply clear the menu
. this can be done by updating FavoriteFragment
with following changes
In onCreateView
, call setHasOptionsMenu(true)
to receive options menu related callbacks in Fragment
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Allows your fragment to receive options menu related callbacks (onCreateOptionsMenu etc)
setHasOptionsMenu(true)
...
}
now override onCreateOptionsMenu
and clear the already populated menu
as
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
menu.clear()
}
Answered By - mightyWOZ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.