From the course: Android Studio Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Rename, move, and extract code

Rename, move, and extract code

- [Instructor] Android Studio has powerful refactoring capabilities, letting you rename your symbols, move files around and also extract code into new factors. I'll show you how to use some of these features in this project, and I'll start with renaming variables. To rename a variable using refactoring, place the cursor in the variable name anywhere, then press Shift + F6 and that's the same keyboard shortcut on all operating systems. You'll see a box appear and then you can start typing a new name. So let's say I wanted to change the variable myClass to myFirstClass. As I type the name in one place, it'll update in the other. Then when I press Enter or Return, that change will be committed. Now you can do the same thing with class names. I'm going to jump to myClass and I did that by holding down the Command key on Mac or Control on Windows and clicking the class name. Now, once again, I'll place the cursor inside the class…

Contents