My research I have found that I need to use below methodology
textView.setTag(1,object1);
textView.setTag(2,object2);
What i tried::
list in place of object but couldn't get it to
work.If need to add multiple tag into one view the you have to define the id for every tag in string.xml file like:
<item type="id" name="section"/>
<item type="id" name="hide_show"/>
after adding the key you can use these keys in java file like below :
rowView.setTag(R.id.section,mSectionList.get(position));
rowView.setTag(R.id.hide_show,"close");
this will set the tag. At the time of getting tag you need to typecast the object which originally you set like :
Section mSection=(Section)rowView.getTag(R.id.section);
String isOpen=(String)rowView.getTag(R.id.hide_show);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With