How can I use duplicate IDs in different layouts?

前端 未结 5 479
太阳男子
太阳男子 2020-12-17 15:59

I have two different layouts for two different Activities. There is a button in each of these layouts with the same id: \"@+id/btnOK\". When I set a property for one of thes

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 16:34

    I imagine there would be an issue in the R.java class, as this class will have public static members corresponding to each View id.

    For it to work, the R.java class would need to rename some of those id's, and then how would you find them?

提交回复
热议问题