How to rename widget id in Eclipse?

I am working on an application based on an example from a tutorial. Now different widget IDs no longer reflect their purpose, so I would like to rename them. However, this seems like a pretty daunting task, as identifiers are used in several files.

Is it possible to somehow rename the identifiers so that the changes are transferred to other files in the project? This is almost similar to the refactoring source code names, but for widget IDs.

+4
source share
4 answers

I do not think such a tool exists in Eclipse. The easiest way to do this manually is to rename the element in the XML layout, and then track for errors in the Java classes. If you do this one by one, you should clean it in a minute or two.

+3
source

You can try using the Find / Replace feature - this is Eclipse. I found this useful several times when changing ID or something like that. Let us know what you are doing.

+3
source

In eclipse:

Go to the xml -> Graphical Layout -> Properties layout, then click the button ... next to the required field:

refactor_widget

+1
source

In case someone runs into this problem now, you can rename the identifier from the visual layout editor and it will automatically do all the hard work.

0
source

All Articles