Question Android Icon menu list

salm2s

Honorable
Jul 21, 2017
266
6
10,815
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

Honorable
Jul 21, 2017
266
6
10,815
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>
 

TRENDING THREADS