Skip to content Skip to sidebar Skip to footer

Changing Id In One Place Changes Id In Other Places In Android Xml File

This issue started happening when I copied a layout into another and tried to refactor the ID in the new file. It tends to refactor the ID in the source file also. This is quite fr

Solution 1:

every time you refactor something, it will change everything related to that particular item or field, if you want to refactor an ID of an item it will change it in everywhere this ID is being used. in order to change the name you can right click and choose refactor and rename or you can press SHIFT+F6 for a shortcut, it will ask you if you want t search it in comments and strings also check that box in order to really change it everywhere that this item is being used.

If you want to rename only the ID in the xml without it being changed in the java file, you'll have to change it by hand 1 by 1 b/c the refactor option will change it everywhere it is being used in your current project.

Post a Comment for "Changing Id In One Place Changes Id In Other Places In Android Xml File"