Reputation: 724
I have list of items with checkboxes in my menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".ListActivity">
<group
android:checkableBehavior="all"
android:orderInCategory="1">
<item
android:id="@+id/all"
android:checkable="true"
android:checked="true"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/category_all" />
<item
android:id="@+id/entertainment"
android:checkable="true"
android:checked="true"
android:title="@string/category_1" />
<item
android:id="@+id/sport"
android:checkable="true"
android:checked="true"
android:title="@string/category_2" />
<item
android:id="@+id/recreation"
android:checkable="true"
android:checked="true"
android:title="@string/category_3" />
</group>
</menu>
but if I click on any item is, the window closes. I know, it should work like this. But I need keep this popup open. Please help me somebody!
Upvotes: 2
Views: 393
Reputation: 266
Try using "return false " in onOptionsItemSelected method . hope it will work for you !!
Upvotes: 1