0

My code shows an error with the text: "Fragment.hasOptionsMenu can only be called from within the same library group prefix (referenced groupId=androidx.fragment with prefix androidx from groupId=Personal Pocket Dictionary"

I've imported the library and have the right dependency "implementation "androidx.fragment:fragment-ktx:$fragment_version"" so none of that is the issue.

Not sure how to fix this

Hamid Ebadi
  • 405
  • 3
  • 4

1 Answers1

2

Use setHasOptionsMenu(true) instead.

cmak
  • 576
  • 1
  • 4
  • 15