Skip to content
Related Articles

Related Articles

Improve Article

What is the Shortcut to Auto Import All in Android Studio?

  • Difficulty Level : Hard
  • Last Updated : 07 Mar, 2021

There are some basics import in Android Studio that is predefined present in Android studio. like Menu, AppBar, MenuItem, Bundle, Toast, etc. When we require those then we import that manually. In case of pasting some code copied from the Internet in Editor, it asks to import every Views and class. You can simply import all of them by pressing the ALT + ENTER key. Here, we are going to explain how to auto-import all in Android studio. 

Import like this:

import android.os.Bundle;


import android.view.Menu;

import android.view.MenuItem;

For Windows/Linux

Step 1: Go to File and then Select Settings

Step 2: Then Go to Editor > General > Auto Import 

Here Select Java and then change Insert imports on paste value to All

Step 3: Then mark the “Add unambiguous imports on the fly” option as checked. Then click on Apply and Ok.

Note: We can import a single missing import using Alt + Enter which shown in the pop-up. To optimize imports (to remove unused imports ) use Ctrl + Alt + O. If for some reason auto-import is not enabled you can go to settings by typing shortcut: Ctrl + Alt + S.

For macOS

If you use macOS, the only difference is where you can configure the above settings. Just click Android Studio > Preferences. The subsequent settings are very similar.

Want a more fast-paced & competitive environment to learn the fundamentals of Android?
Click here to head to a guide uniquely curated by our experts with the aim to make you industry ready in no time!
My Personal Notes arrow_drop_up
Recommended Articles
Page :