0
I have the following menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_delete"
android:orderInCategory="100"
android:icon="@drawable/ic_delete_white_32dp"
android:title="@string/action_faults_delete"
app:showAsAction="always" />
</menu>
I add it in a Fragment
as follows:
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_delete, menu);
}
On this screen I have a list of selectable items!
I would like to display the menu only when I have a selected item!
My question is how to hide/show this menu?