From the course: Android Studio Essential Training 2020

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Refactor and inspect code

Refactor and inspect code

From the course: Android Studio Essential Training 2020

Start my 1-month free trial

Refactor and inspect code

- [Instructor] Android Studio has powerful refactoring capabilities letting you rename your IDs, move files around and extract code into new factors. I'll show you how to use some of these features in this project that I created from the empty activity template. First, I'll show you how to rename variables and functions really easily. In this function, I'll create a new local variable called myVar and I'll set its value to a literal string of hello from Android. And then I'll output that value to the logcat window with printlm. Now, let's say I want to rename that variable. I'll place my cursor in the variable name and then use the keyboard shortcut, shift, f6 and that's the same keyboard shortcut on both Mac and Windows. Now, with that little box that appears, I'll start typing the new name and notice that the reference for the variable changes at the same time. The same thing works for functions. I'll create a…

Contents