0

In my application there was a listview, and multi choice mode is enabled for this listview. When user long clicks the list item i am inflating new menu using setMultiChoiceModeListener. And in my menu there was 3 items are include but only 2 of them is visible always, i want to display all of the 3 menu items always in multichoice mode. How can i achieve this.?

This is my menu inflating while multichoice mode is enabled

    <?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/forward"
        android:icon="@drawable/forward"
        android:title="forward"
        app:showAsAction="always"
        />
    <item
        android:id="@+id/delete"
        android:icon="@drawable/delete"
        android:title="delete"
        app:showAsAction="always"
        />
    <item
        android:id="@+id/copy"
        android:icon="@drawable/paste_small"
        android:title="copy"
        app:showAsAction="ifRoom"
        />
</menu>
  • @Alok Nair Thanks for your feedback, but i had already checked that and it is not working – Nidheesh Kumar S V Dec 14 '15 at 06:04
  • @AlokNair Override public boolean onCreateActionMode(ActionMode actionMode, Menu menu) { actionMode.getMenuInflater().inflate(R.menu.multichoice_menu, menu); return true; } – Nidheesh Kumar S V Dec 14 '15 at 08:43
  • Oh ! Fixed the issue.. My menu file is perfect no issue with that. Problem is programatically i have been changing the visibility of menu item in certain conditions. – Nidheesh Kumar S V Dec 14 '15 at 08:55

0 Answers0