Use this shortcut and start typing any class name. This can be useful when you want to rename all the iterations of a particular variable or other code. Using the multicursor shortcut, you can select a particular block or line of code and on pressing Ctrl + G on mac, it will select the next iteration where that code appears and again pressing the shortcut, you can further continue the selection as shown below. A prompt will open asking you to name the activity and a new Java file will be created. Using the above shortcut you can create a lot of things quickly without wasting your precious time.įor example, if you want to create a basic Java Activity, press Cmd + Shift + A in mac and then type “basic activity” and select the option that shows and press enter. You can even create your own live template by navigating to File > Setting > Editor > Code Style > Live Templates Search for Command Hence write Toast and press tab and voila! You didn’t have to write the entire line for creating a toast message. And when you know the names of these live templates, you can just write the name and press tab and see the magic.įor example, the code for the live template for showing a toast message is “Toast”. On using the above shortcut, you will see a list of all the live templates you can use and by clicking on any of them, the IDE will write the code for the functionality shown. With the help of Live Templates, you can easily eliminate writing boilerplate code by using shortcuts for specific things. And I can assure you that you will enjoy coding your app using these cool shortcuts. All that you would need to use while coding will be your fingers and a few combinations of keys. I use these shortcuts and hence know the importance and the amount of time that it saves.Īnd more importantly, they just let you code consistently without any breach of moving to your touchpad and looking for that option. Today in this post, I will list some important and useful Android Studio shortcuts which, when used will save a significant amount of your time. A good developer knows how to write an efficient code but an awesome developer knows how to write that efficient code more efficiently.
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |