How do I call onCreateMenuOptions just once when the fragment is being created

68 Views Asked by At

My activity contains many fragments and it has been found that every time a bottom sheet fragment opens up in the activity, the onCreateOptionsMenu function gets called again. How do I ensure that the function gets called only during the start of the Activity

I tried using add menu provider, setHasMenuOptions and invalidate function.

0

There are 0 best solutions below