I'm trying to create this kind of list menu but with no success:
I would like to use the Android menu button or to press an arrow with "open" or "close" text. That menu will display a list of options :
- [Icon] + Open/close
- [Icon] + Take a picture
- [Icon] + Import pictures from the gallerie
- [Icon] + Delete picture alrealy sent
But, I've got this kind of result, a menu as block options:
I'm using this code from Android developer website :
XML File (/menu/gallerie_menu.xml) :
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open_or_close"
android:icon="@drawable/ic_open"
android:title="@string/open"
android:showAsAction="ifRoom"/>
<item android:id="@+id/take_pic"
android:icon="@drawable/ic_camera"
android:title="@string/take_picture" />
<item android:id="@+id/import_pic"
android:icon="@drawable/ic_import"
android:title="@string/import_picture" />
<item android:id="@+id/delete"
android:icon="@drawable/ic_delete"
android:title="@string/delete_picture" />
</menu>
Java code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.gallerie_menu, menu);
return true;
}
Could someone advise me or suggest something to me?