I have a problem with my app. I need to show a PopupMenu
and I need every item in this menu to contain text and an image. The images should be displayed to the left of the text. But it is not showing, any suggestions how to make it happen?
My code so far below;
public void showMenu(Button button) {
PopupMenu popupMenu = new PopupMenu(this, button);
popupMenu.getMenuInflater().inflate(R.menu.config_menu, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
switch (menuItem.getItemId()) {
And my options menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/dial"
android:icon="@drawable/phone"
android:title="@string/dialText"/>
<item
android:id="@+id/GPS"
android:icon="@drawable/gps"
android:title="@string/gpsText"/>
<item
android:id="@+id/Record"
android:icon="@drawable/record"
android:title="@string/recordText"/>
<item
android:id="@+id/notActive"
android:title="@string/not_active"/>
This is what I see (red boxes added to show where the images should go);