I am new to Android development. Is it fine to use the same ID for images and TextViews
in different Layout
XML files?
When eclipse auto-li
Not recommended, because if in future you will need to refactor the view
id
, Android studio will refactor it in all XML
files and classes and you will get into trouble.
But there are also some cases when you do need to use same id
for example if you have some abstract and you reuse multiple layouts.
In case you have multiple views
with same id's
in your project and you need to refactor, do it manually, don't use build in IDE function, change the id
in the target view inside XML
layout then fix the red error inside layout.