So, I have this XML file in my layouts directory called "actionbar_buttons.xml":
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <item android:id="@+id/action_settings" android:title="Settings"> </item> <item android:id="@+id/action_settings2" android:title="fooo"> </item> </menu>
In my Fragment class, I call the inflate method as follows:
@Override public void onCreateOptionsMenu( Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu( menu, inflater ); inflater.inflate(R.layout.actionbar_buttons, menu); }
Now Intellij complains and tells me:
Expected resource of type menu less... (Ctrl+F1) Reports two types of problems: Supplying the wrong type of resource identifier. For example, when calling Resources.getString(int id), you should be passing R.string.something, not R.drawable.something. Passing the wrong constant to a method which expects one of a specific set of constants. For example, when calling View#setLayoutDirection, the parameter must be android.view.View.LAYOUT_DIRECTION_LTR or android.view.View.LAYOUT_DIRECTION_RTL.
The code really works. I am just annoyed by this warning in Intellij, and I'm not quite sure that I am doing something wrong.
source share