How can I use duplicate IDs in different layouts?

前端 未结 5 476
太阳男子
太阳男子 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条回答
  •  醉酒成梦
    2020-12-17 16:49

    I resolved the problem but I did not find the reason. In my manifest file, one of activities had the "android:label="@string/app_name". I removed it and set it for my main activity.

    Previous manifest:

    
        
            
            
        
    
    
    
    

    New manifest:

    
        
            
            
        
    
    
    
    

    Does anybody know the reason?

提交回复
热议问题