android getMenuInflater() in a fragment subclass - cannot resolve method
I am trying to inflate a menu in a class that inherits the Fragment class. Here is my OnCreateOptionsMenu() method - @Override public boolean OnCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.forecastfragment, menu) ; return true; } This raises the following error: Cannot resolve method 'getMenuInflater()' I tried : MenuInflater inflater = getActivity().getMenuInflater(); but then Android Studio highlights @Override in red and states: Method does not override method from its superclass I also tried to create a getMenuInflater method in the same class and have it return new