Can I use the same id in different layout in Android?

Short answer: Yes, you can.

Long answer: You can do this because whenever you use findViewById() to get a reference to a part of your layout, the method only looks for that view in the currently inflated layout. So even if you have another view with the same ID in another layout, Android will not look for it there.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)