How to prevail a variable name in only one class

I have a question that can save me and many others many hours. Is there a way I can use the refractor in android studio to change the variable name in only one class? I understand that this is confusing, but I recycle a lot of code between my classes, so when textViewit can be called in one action txt1and I copy and paste it into a new action, it should become txt2, so instead of doing it in a couple thousand lines of code, is there a way that I can change txt1inside ONLY SECOND CLASS to txt2automatically? Thanks everyone!

+4
source share
3 answers

I solve this problem, I used the function find and replacein NotePad ++. This may not be the only way to do this, but it was very simple and fast.

+1
source

It is much easier than you think. Follow these steps:

  • Right click on any variable / class / method that you want to rename.
  • Choose RefactorRename

or select any thing you want to rename and press shift+F6

Now you can easily rename.

+2
source

. Android Studio/intelij . , . IDE , . bean. , , , , .

+1

All Articles