Adding two R.id in a single TextView in xml

后端 未结 2 795
慢半拍i
慢半拍i 2021-01-21 13:00

I have two android:id .

For example: [ R.id.custom_font ] and [ R.id.product_name ]

In .java file

 TextVie         


        
相关标签:
2条回答
  • 2021-01-21 13:36

    I don't see the point of having two IDs for one view...

    Just use the R.id.custom_font again in the following line:

        adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.custom_font,  products);
    
    0 讨论(0)
  • 2021-01-21 13:39

    No, it is not possible. You can have only one android:id associated with one component.

    0 讨论(0)
提交回复
热议问题