In this Android Studio Note video you’ll learn about the helpful refactor type shortcut:
Tip: turn on subtitles to deal with my accent. A full transcript is also available below.
Watch the playlist with all Notes here: ►
Future Studio is helping 5,000+ users daily to solve Android and Node.js problems with 320+ written tutorials and videos. We’re on a mission to provide new in-depth content every week.
Checkout 320+ technical in-depth tutorials:
Subscribe for two new videos every week:
Follow us on social media to get updates on new content:
Hey what is up everyone, Norman from futurestud.io University here and welcome to another video in Android Studio Note series. In less than five minutes you will learn a little trick to increase the productivity every single day.
Today we have the refactor type shortcut. I did that a lot in my past so if I wanted to change a type for example of a variable or maybe as a return type of the method I started just changing the type directly and then look through my code that nothing broke. That usually snowballed to more and more things that I had to fix and eventually it was a mess.
So much better is if you use a command+shift+f6 shortcut or control+shift+f6 for the Windows users and it will suggest you a little dialog where you can directly change the return type.
So that changes from boolean to string. What you will see is that it will show you all the things that will break with this [change]. So you will see these three return true or false statements. They can’t return, because that’s not a string. So this needs to be fixed and you will also see that there is an expression which calls this method which expects the boolean and not a string. We will also need to fix that.
You can use this dialog to help you get an overview what you need to change before making the changes. This increases the chances that your changes will be successful. This also reduces the risk that something breaks in your code because it didn’t think about this change before.
So please use the refactor type dialog to make sure that you won’t break your code.
Thank you for watching. If you didn’t know the refactor type dialog before give this video a like and subscribe for more videos.
Make it rock!