I just wanted to know if my application will work fine if two buttons in different activities have the same id. What are the possible complications that can arise due to this.
Thanks for the help!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes , you can use same id in two different activities. In fact, it may be good practice to.
If in the same layout, you won’t be able to create a duplicate id.
Edit
AFAIK you can use the same id in different activities because when you
and inflate layout then android itself searches for that particular id in that particular layout so no problem here.