Good Day. I am relatively new to android programming and I am having problems displaying action Items on my action bar. I can manipulate my actionbar through Java code (show and hide text, Icon and action bar), however when I try to add my own images to the action bar they don't show up. I know it recognizes at least one of the png images as it shows up in android studop, however when I run the code it doesn't display. Is there any java code that I need to insert in order for this to happen?

Here is my xml code:

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/add_icon"
        android:title="Add Contact"
        android:icon="@drawable/add"
        android:orderInCategory="0"
        android:showAsAction="ifRoom"/>
    <item
        android:id="@+id/setting_icon"
        android:title="Preferences"
        android:icon="@drawable/pref"
        android:orderInCategory="0"
        android:showAsAction="ifRoom"/>


</menu>

The xml is in the res/menu folder.

Thanks for any help that can be provided. (I am using API 11+ so there is no need for the support library)

Forgot to include the method to bring up the menu in my java code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.