Skip to main content

android xml: reference a menu in multiple places. -


i have:

<item android:id="@+id/fp_pitcher" android:title="pitcher"> <menu> <item android:id="@+id/caught" android:title="caught"> </item> <item android:id="@+id/not_caught" android:title="not caught"> </item> </menu> </item> <item android:id="@+id/fp_catcher" android:title="catcher"> <menu> <item android:id="@id/caught" android:title="caught"> </item> <item android:id="@id/not_caught" android:title="not caught"> </item> </menu> </item> <item android:id="@+id/fp_firstbaseman" android:title="first baseman"> <menu> <item android:id="@+id/caught" android:title="caught"> </item> <item android:id="@+id/not_caught" android:title="not caught"> </item> </menu> </item> <!--snip, continues every fielding position. --> 

so see inner menu same each of outer items. there way can reference same menu on , on again? save me time later, if needed modify inner menu.

android xml: reference menu in multiple places. - stack overflow

learn, share, build

each month, on 50 million developers come stack overflow learn, share knowledge, , build careers.

join world’s largest developer community.

sign up

i have:

<item android:id="@+id/fp_pitcher" android:title="pitcher"> <menu> <item android:id="@+id/caught" android:title="caught"> </item> <item android:id="@+id/not_caught" android:title="not caught"> </item> </menu> </item> <item android:id="@+id/fp_catcher" android:title="catcher"> <menu> <item android:id="@id/caught" android:title="caught"> </item> <item android:id="@id/not_caught" android:title="not caught"> </item> </menu> </item> <item android:id="@+id/fp_firstbaseman" android:title="first baseman"> <menu> <item android:id="@+id/caught" android:title="caught"> </item> <item android:id="@+id/not_caught" android:title="not caught"> </item> </menu> </item> <!--snip, continues every fielding position. --> 

so see inner menu same each of outer items. there way can reference same menu on , on again? save me time later, if needed modify inner menu.

share|improve question
    
you can refer menu @ multiple places inflating layout menuinflater. – akashg jul 7 '12 @ 7:03
    
@akashg - mean using menuinflater in oncontextitemselected? if - how reference menu pass inflate? – dwjohnston jul 12 '12 @ 1:08

your answer

 
discard

posting answer, agree privacy policy , terms of service.

browse other questions tagged or ask own question.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -