I have 16 buttons and I tag them to pair some terms set to buttons and imported from sqlite database. So, I tag them like this:
// labelForButton and tagForButto
If you need to add multiple tag into one view then you have to define the id for every tag in strings.xml
file like:
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:
String mSection=(String)rowView.getTag(R.id.section);
String isOpen=(String)rowView.getTag(R.id.hide_show);