In Android Studio, I sometimes have to rename some field, attribute or method name. I know I must select its name, then hit Alt+Shift+R. Then I type in the new name, and hit Enter.
However, sometimes it works, and sometimes... it just does nothing at all. The new name is just discarded and replaced with the old ones.
Can someone explain me why and how to force this very basic feature to work ?
If you're on Windows or Linux you should be able to rename all occurrences of your variable (variableAusgabe) by just using the Ctrl + Shift + R shortcut. When you use this, a pop-up shows up and you have to enter the text you want to replace (variableAusgabe), and the text you want to replace it with.
Step by Step Implementation Step 2: Now click on the setting gear icon and deselect Compact Middle Packages. Step 3: Now the packages folder is broken into parts as shown in the below image. Step 4: Now right-click on the first package name (com) and Refactor > Rename.
This also happens when using dagger and trying to refactor via Shift+f6. Android Studio hesitates when renaming things in generated code (which seems silly). Anyway, doing a project clean and then doing the rename works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With