Shortcut keys to know from Eclispe to Android Studio (as how to modify shortcut keys)

Source: Internet
Author: User

      • Quick Comment Custom shortcut keys
      • Shortcut Builder Ctrl Enter or COMMANDN
      • Mouse Tips
      • Quick Find Next same variable Ctrlkcommand K
      • Qandroid Studio does not automatically prompt for code completion does not automatically check the wrong

1. Quick Comments (custom shortcut keys)

In Eclispe, "alt+shift+j" can quickly generate comments for [function/member variable/class], which is very convenient. (If you don't know, just try!) )-point I see effect-

In Android Studio also has this feature, default is no shortcut key, we can set our own (I used to set to the same location as Eclispe, Mac is set to "Command+shift+j").

How to change the shortcut keys in Android Studio (learn to extrapolate)

The following are examples of MAC editions:
Open Android Sudio->preference, search for keymap in the search bar, search for "fix doc comment" in the search bar on the right

Then click on the "Fix doc comment" option and select "Add Keyboard Shortcut"

In the new open interface, the first line of the cursor, directly press the keyboard you want to combine the shortcut keys (such as my "command+shift+j"), observe the conflicts column as "No conficts" indicates that there is no conflict with other shortcut keys, click OK.

This time you will find the "Fix doc comment" column after the yellow shortcut key identification

PS: Other shortcut keys are in the Keymap, you can use the above method to change their habits.

Change the effect (quickly generate a document comment):

2. Shortcut Builder (Ctrl + Enter or command+n)

There are many methods in Eclispe, such as constructing method generators, which can choose which member variables to take, getter and setter can quickly generate member variable access method, and so on.

Use the shortcut key "Ctrl + Enter" or "Command+n" (Mac) to quickly appear in the Generator shortcut interface.

You can see that the first is the constructor, and the second to the third is the accessor, as well as the Interpreter (ToString ()), the method of overriding the parent class (override Methods), and so on.

There is a skill when choosing a setter, and in the "Template" tab above, the setter can choose Builder

The resulting set of settings returns the instance of this class, and the benefit is that it can be set as a continuous parameter.

    test.setTest1(1).setTest2(2).setTest3(3);

You can see that the fragmenttransaction in the Android source code has such a similar use:

    FragmentTransaction ft = getFragmentManager().beginTransaction()    .add(R.id.content, mFragment)    .commit();

Pull away

3. Mouse Tips

Placing the mouse on the class code in eclipse automatically displays the information for the class.
It's not automatically prompted when you're using Android studio.

Android Studio, by default, does not, as with eclipse, move the mouse over a class or method or variable, and a hover box pops up to display the relevant document. However, Android Studio can be configured to implement this feature.

Operation Steps:
"Mac Edition" Android Studio---Preference->editor, General, and on the right find the title "Other" column, tick?? Show Quick doc on mouse move Delay (ms)

Reference: "Android Studio Display Mouse Tips" (according to the above path can not be found in the reference article to see if the path is feasible)


4. Quickly find the next same variable (Ctrl+k/command +k)

In eclipse, whenever a variable is selected and then Ctrl+k, the cursor is automatically positioned where the next variable is used, and the name of the shortcut is actually "Find Next."

Based on the 1 learned custom shortcuts, we can go to keymap find Next.

You can see that the default shortcut key is Command+g, you can change to use the same as the Eclispe in the same shortcut keys, change the attention to avoid shortcut key conflicts.

Q:android Studio does not automatically prompt for code completion, do not automatically check the wrong?

A:file, Power Save mode, just before you remove it.

The reason for not taking effect is because as is set to the power saving mode, when set to the power saving mode, as will prohibit some auxiliary functions, to achieve the purpose of saving electricity. So the code automatic hints are also banned.

/** * * ━━━━━━待开发区━━━━━━ *    ┏┓   ┏┓ *   ┏┛┻━━━┛┻┓ *   ┃       ┃ *   ┃   ━   ┃ *   ┃ ┳┛ ┗┳ ┃ *   ┃       ┃ *   ┃   ┻   ┃ *   ┃       ┃ 废话多的有点像 *   ┗━┓   ┏━┛ *     ┃   ┃                凑 字 数 *     ┃   ┃ *     ┃   ┗━━━┓ *     ┃       ┣┓ *     ┃       ┏┛ *     ┗┓┓┏━┳┓┏┛ *      ┃┫┫ ┃┫┫ *      ┗┻┛ ┗┻┛ * * ━━━━━━待开发区━━━━━━ */

Copyright NOTICE: This article is for bloggers original article, reprint please indicate the original address and author (Ahan).

Shortcut keys to know from Eclispe to Android Studio (as how to modify shortcut keys)

Related Article

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.