Android Studio automatically removes excess import

Source: Internet
Author: User

In the development process, as the project iterations, the file part of the import may have been unused, for this useless import, we can not one file deletion. Here is a feature that automatically deletes unused import.

first, the development environment:Android Studio 1.5

Ii. Methods/Steps

1. Start Android Studio, open the project, and you can see that the Java file has an extra import,

2. Click "Code" in the menu,

3.

Re-select the submenu "Optimize Imports ...".

3.1 The unused import in the current file is automatically deleted when "Optimize Imports ..." is selected, since the current file is selected.

3.2

After deleting the file,

4. The above operation, in fact, you can select the files to be manipulated, right-click, in the Display menu also has "Optimize Imports ..." Options.

5. If the folder is selected, a dialog box will pop up when "Optimize Imports ..." is selected. In the dialog box, you can choose to delete the extra import only for files modified within the current folder;

5.1. Click the "Run" button to start deleting the unused import operation for the files in the current folder. 6. If you want to perform an optimized import of all Java files in the directory, you can select the directory you want to apply in the Project window and execute the previous process.

Android Studio automatically removes excess 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.