Finding items in a group [android] -


when click menu item want able un-check other items contained in same group can create radiobutton effect. object need cast item.getgroupid() to- able siblings , uncheck them? here code

    int groupid = item.getgroupid();      if (item.ischecked() == false) {         item.seticon(android.r.drawable.checkbox_off_background);         item.setchecked(true);     } else {         item.seticon(android.r.drawable.checkbox_off_background);         item.setchecked(false);     } 

here xml general structure

<menu> <group id = "mygroup" <item/> </group> </menu> 

thanks lot. if knows how make icon begin on right instead of left of each item awesome, im new android , lot

in xml menu, set group attribute android:checkablebehavior single described in documentation.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -