android - How can I add multiple tags for one view directly in XML? -
as question states want add more 1 tag xml view. example, want set array of strings , separate string resources. know how them individually want know if there's way of attaching more 1 tag view directly within xml code.
edit:
my plan have linearlayout (l#1) contained dynamic amount of of different linearlayout (l#2) , within view there spinner , edittext. need 1 tag hint of edittext , other array of strings populate spinner. in entire layout there multiple l#1 each using l#2 populate dynamically , each needing different hints , string arrays based on used for.
my next idea add integer tag represent l#1 , and use switch/case block in code populate children of l#2 right hints , string arrays.
i don't think possible in xml, in code create custom object holds strings require , set tag.
class customtagobject { public list<strings> strings; public string mystring; }
then later
customtagobject tagobj = new customtagobject(); tagobj.strings = new arraylist<strings>("string 1", "string 2"); tagobj.mystring = "string resources"; view.settag(tagobj);
if explain why want hold these items tag, may able find alternative approach?
Comments
Post a Comment