I am developing an Android application using Honeycomb android 3.0 . I am trying to display a menu in Action Bar . The menu has an icon and title. When we click the menu item it displays its items in the form of a dropdown list. It was the items in drop down list with item names but without icon it is displaying.
I want an icon to be displayed beside the title in drop down list which appears when I click the menu. can anyone help me in sorting out this issue. My XML file is as below:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/addserver"
android:icon="@android:drawable/ic_menu_add"
android:title="Add Server"
android:showAsAction="ifRoom|withText"
>
<menu>
<item android:id="@+id/fileserver"
android:icon="@android:drawable/ic_menu_add"
android:title="File Server"
android:onClick="onCreate"
android:showAsAction="always"/>
<item android:id="@+id/sharepoint"
android:icon="@android:drawable/ic_menu_add"
android:title="Share Point"
android:onClick="onCreate" />
</menu>
</item>
Initially it displays add server with icon on left. clicking on that will display fileserver, sharepoint as dropdown list without icon though I given android:icon statement.
How can I sort out this issue?