Member-only story
Android Studio tip — Exclude unwanted imports
The auto-import functionality of Android Studio is often cluttered, presenting the user with imports for deprecated classes. For example, even though junit.framework.Assert
is deprecated, the IDE still provides it as a choice when auto-importing and auto-completing on assertEquals
:
Fortunately, there’s something simple you can do to exclude certain imports.
With auto-import, navigate with the right-arrow key to display exclusion options:
With auto-complete, press Option ⌥ + Return on a Mac to display the same exclusion options:
Selecting any of the items in these exclusion menus presents the below dialog with your chosen…