How to set multiple tags to a button?

后端 未结 4 1622
既然无缘
既然无缘 2021-02-07 07:12

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         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-07 08:06

    You should use the setTag(int key, Object tag) method, which also takes a second parameter key. This will allow you to set multiple tags on each Button like this :

    button.setTag(1,object1);
    button.setTag(2,object2);
    

提交回复
热议问题