Android Studio Auto Import (All) package import

Source: Internet
Author: User

http://blog.csdn.net/buaaroid/article/details/44979629

1 Android Studio Only import the shortcut keys for a single package: Alt+enter. There are no shortcut keys for quick import packages under Eclipse Ctrl+shift+o.

2 There is an auto import feature in the Android studio settings. The setup process is as follows:

Android Studio--file--> Settings-----Auto Import: Then set up like 1.

Figure 1

The parameters in the settings are explained below, reproduced as follows:

XML
Show Import Popup, which is used for editing XML, automatically pops up an import dialog box asking if you need to import.


Java


Insert Imports on paste:(all ask None), which is actually an option for you to ask for an imported package when you copy the code .
All: When you need to import the package name, it will be imported automatically, will not play the prompt box
ask: When you need to import the package name, a pop-up box asks if you want to import
None: When you need to import a package name, the prompt box does not bounce and is not imported automatically.


Show Import Popup: This is different from the above insert imports on paste. Ha, don't mix, this means that when the declaration of the class you entered is not imported, a selection dialog box pops up. but this is a bit of a problem to note here. Whether you check or not, anyway, the dialog box will not pop out, after you lose the class name, the declaration is automatically imported. So I guess this could be a bug in Android studio.
Optimize imports on fly: This is actually the same as the shortcut key Ctrl+shift+o/ctrl+alt+o, which is to remove the unused declarations.
Add Unambiguous importson the fly: This is the automatic import function, when you enter the class name, the declaration is automatically imported.

Exclude from Import and completion: This is actually your custom Import. You don't have to pay attention, generally you can't use it.

Android Studio Auto Import (All) package import

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.