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

Source: Internet
Author: User

In general, the more keyboards with fewer mouse use, then write code to the higher efficiency; The common shortcut keys must have been mastered, and then I will share some very useful shortcuts that you may not know about.

All shortcut keys below are based on the following keymap
Windows:default
Linux:default
Osx:mac OSX 10.5+

is the auto-completion time enter or Tab?

Auto-Complete enter and tab differences


EnterThere are some subtle differences in the behavior of using auto-completion Tab :

    1. Use Enter the statement that will fill your selection
    2. TabIf you use it, it will replace your previous content (delete the following statement until you encounter the dot, comma, semicolon)

In this case we will often encounter, such as to replace the ID of a resource (r.id.a_xxx_xxx), presumably most people are first to choose to a.xxx_xxx Delete, then enter new content, or vice versa, in fact, in the Tab most elegant way.

Shortcut keys: (at the time of completion)Enter/Tab

Return to editor window

Return to editor window


When writing code, a lot of actions will leave the focus out of the editor, such as Find Usage, Logcat, switch to Project structure view, type inheritance tree, etc. if the view switches how to quickly cut back to the editor to continue writing code? Simple mouse click on the editor, but in fact there are two options:

    1. Esc: Let the editor window get the focus, then you can enter the code
    2. Shift + Esc: This will get the editor to focus and help you close the window you just opened.

Individual likes the second kind; Find usage is complete, Shift + Esc elegance ~

    1. Esc: Return to Editor
    2. Shift + Esc: Returns the editor and closes the current window
Returns the last tool window opened

Returns the last tool window opened


After that function, if you Shift + Esc write a little bit of code, what do you do when you find that you need to open the window? This scene usually occurs in Logcat this tol window, read the log, write code, write the code to look at the log, how to quickly switch?

Shortcut keys:F12

Quick Open Window

Open a window with a numeric shortcut


There's a wooden window with a number on it. Such a window (tool window) we can open quickly!

    • Mac:Cmd + 数字
    • Windows/linux:Alt + 数字
Any window switch

Window switch


The above switch is still unable to meet your requirements? Remember Mac Cmd + Tab , Windows? Alt/Win + Tab Android Studio also has this similar feature that allows you to switch to any window!

When the switch window is open, you can switch directly to the corresponding tool window by the number, or enter the letter to search the right editor window, if you need to close a window, click on it BackSpace .

Shortcut keys:Ctrl + Tab

Hide All windows

Hide All windows


Well, having learned so many skills to open windows, what if you want to close those messy windows and write the code quietly?

    • Mac:CMD + Shift + F12
    • Windows/linux:Ctrl + shift + F12

If you need to restore all windows, press this shortcut again.

Parameter hints

Parameter hints


This feature is estimated by a lot of people, but it's still a bit of a mention. After auto-completion, if a method parameter is super long, you don't know what to do with the parameter? You can try this.

      • Mac:CMD + P
      • Win/linux:Ctrl + P

Android Studio shortcut keys You don't Know (a)

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.