Android Studio You don't know the shortcut keys (iii)

Source: Internet
Author: User

This article will continue to introduce some very useful shortcuts that you may not know about, but you can move forward without looking at the top two articles:

    1. Android Studio You don't know the shortcut keys (a)
    2. Android Studio You don't know the shortcut keys (ii)
Select in..

To tell the truth, I can't think of a better translation:P simply use English.

Select in..

Is there a scenario where you open an image file (or other file) in Android studio and want to view the image in a resource browser; in Eclipse I think most of the people Alt + Enter go into the file attribute copy address and then open it in System Explorer , or install a Easyexplore plugin. Inside Android Studio, this is built-in support! And it's more than that! For example, you want to see which directory of a file is in the package, usually not by clicking on the small circle coordinate on the project view, or by using this shortcut mouse.

Shortcut keys:Alt + F1

Pop-up menu has a series of options, according to the corresponding number can be selected, the other menu has what function can try it yourself.

Expand your selection

Expand your selection

This feature should be known to a lot of people, but let's just say it, because the following two features combine with this to be powerful. This function is too powerful, you can press a few times to think of a lot of use scenes, I believe that with this feature, you will have a lot less chance to use the mouse.

    • Mac:Alt + up/down
    • Win/linux:ctrl + w / ctrl + shift + w
Surround with.

Surround with

What do you do if you want to if wrap a piece of code in a statement or use try a code that surrounds a possible run-time exception?

First, use the cursor to locate the code block at the beginning, and try { then, at the end of the cursor code block, add } catch (XXXRuntimeException e) {// todo} ? You can try this shortcut key.

    • Mac:cmd + alt + t
    • Win/linux:ctrl + alt + t

You can use the extended selection above to select the block of code you need, and then use this feature to Surroundwith; If you choose Nothing, the default is to select the line of the cursor.

Unwrap/remove

Unwrap

This function with the above mentioned is a pair, with the Surround with nature has unsurroundwith; the use of the situation is not as many as the above, but at least one pair, introduce it together.

Highlight Sth.

Highlight something

Sometimes when you look at the code, you see a variable that you want to know where to use it, are you still looking at it with the naked eye? Or are you overkill Find Usgae ? In fact, your demand is to put this variable all to give me a tag, I want to intuitively know where it is.

    • Mac:cmd + shift + F7
    • Win/linux:ctrl + shift + F7

This key function is far more than this!

    1. If you highlight return or throw , you will highlight all the return points of this method!
    2. Highlighting a class extends or implements highlighting the class override method
    3. Highlighting import will show the place to use

If you don't want to highlight it, press ESC on the line.

Show method Call Tree

Method Call Tree

When looking at the source code, do you still use alt + F7 and ctrl + B shuttle between the various classes? In fact, many times you just want to know what this call structure is, and who is going to call who by the step-by-step; This shortcut will give you a call tree. With this big chrysanthemum view, it is easy to continue the discussion.

Shortcut keys:ctrl + alt + h

Universal shortcut keys

Universal shortcut keys

Remember that a universal refactoring key has been mentioned before, and everything you can do about refactoring is done through it. So the Android studio so shortcut keys, so many features, how can my concubine remember! If only I had the master key! That ' s it!

Use this shortcut key, you think of what function, open it to search on it; for example, I would like to see for each whether the Java loop and the normal for loop bottom is the same implementation; then I need to see the virtual machine bytecode; I remember having this function but I don't know what the shortcut is; OK, Cmd + shift + A, enter bytecode :

PS: (IntelliJ idea,android Studio I use does not have integrated bytecode functionality and may not be searchable)

Well, in fact, all the functions of the shortcut keys can be used to search for ~ ~ really do not remember to use the Universal key Bar!

Android Studio You don't know the shortcut keys (iii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.