I'm new to Android and I've been trying to add a simple add button as mentioned below
list_menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_insert"
android:icon="@android:drawable/ic_menu_add"
android:title="@string/menu_insert"
/>
</menu>
MyActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.list_menu, menu);
return true;
}
I read in Dummies series book that ic_menu_add is already there in resources and I don't need to add it, but when I run this code it does not display. I've tried to add a custom icon with same name still there is no button. Can someone help me with it please.