Changing shortcuts and automatic package for Android studio

Source: Internet
Author: User

Changing shortcuts and automatic package for Android studio

I just transferred to Android Studio, but I am not familiar with some operations in AS, so record it...

Change the code prompt shortcut key in AS. AS is also very intelligent. You can choose to use eclipse shortcut key settings in Keymap, but although it is set, it is still unavailable for some shortcut keys, then we need to modify it manually.


When the code prompts that the default AS shortcut key is Ctrl + Alt + Space, I am not used to it, or change it to Alt +/in eclipse, you must copy a copy of the shortcut key to modify it:


During the modification, we will find that there is a shortcut key conflict prompted by the AS, that is, this Alt +/has been used, then we will find the shortcut key to cancel using Alt +, so how can we see whether there is a conflict? For example:


In, I entered a line of code comment shortcut key, and then in the box below, the red font is the prompt for the conflict shortcut key, how many pairs of braces [] There are many shortcut key conflicts, so what are the shortcut keys of the conflict?

For example, if the shortcut key conflict of the first Line [Main menu "Code | Comment with Line Comment], it indicates that the Comment with Line Comment key conflict under the Code subdirectory under the Main menu directory, find it and modify it.

Other shortcut keys, such as Ctrl +/, Ctrl + Shift +/, search for Ctrl + F, view the source code, and press Ctrl + the left mouse button, one-click modification of variable name Shift + Alt + R remains unchanged. However, when we create a JavaBean, we want to automatically generate getter, setter, toString (), or rewrite the parent class method. In this case, the AS shortcut key is Alt + Insert by default, if you are not used to this shortcut key, you can change it to Shift + Alt + S in eclipse.


Finally, let's talk about how to set the AS automatic import package:

Android Studio bug. Optimize imports on fly: This is actually the same as the shortcut key Ctrl + Shift + O/Ctrl + Alt + O, that is, remove unnecessary declarations. Add unambiguous imports on the fly: This is the automatic import function. After you enter the class name, the Declaration is automatically imported. Exclude from Import and Completion: This is actually your custom import. You don't need to pay attention to it. Generally, you can't use it.


,






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.