[SOLVED] Android Icon menu list

salm2s

Respectable
Jul 21, 2017
256
4
1,815
9
Hi there,

So i wanted to add an menu with an image. So I made a new resource directory and called it menu. Then i did this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item android:id="@+id/menu"
        android:icon="@drawable/ic_launcher"
        app:showAsAction="ifRoom"
        android:title="Test"
        />

</menu>
The problem is that when i click on the image, the menu item 'Test' does not show.

Is there a way to fix this?

Thanks,
salm2s
 

salm2s

Respectable
Jul 21, 2017
256
4
1,815
9
Never mind, found out how to do it:

Code:
    <item android:id="@+id/menu"
        android:icon="@drawable/ic_launcher"
        app:showAsAction="always"
        android:title="">
        <menu>
            <item android:id="@+id/test"
                android:title="Test"/>
        </menu>
    </item>

</menu>
 

salm2s

Respectable
Jul 21, 2017
256
4
1,815
9
Never mind, found out how to do it:

Code:
    <item android:id="@+id/menu"
        android:icon="@drawable/ic_launcher"
        app:showAsAction="always"
        android:title="">
        <menu>
            <item android:id="@+id/test"
                android:title="Test"/>
        </menu>
    </item>

</menu>
 

ASK THE COMMUNITY

TRENDING THREADS