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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -