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

1 Answer 1

2

Use setHasOptionsMenu(true) instead.

Sign up to request clarification or add additional context in comments.

4 Comments

This is the one
Consider marking my answer as accepted or, in case the issue wasn't solved, please inform about it.
gotcha this was my first question, i was wondering how to do that and literally had to google it. not too apparent when youre new
Haha, no problem

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.