I recently started Android Studio IDE to make my android apps. I find shortkey to remove unused import in Android Studio is not working (Ctrl+Shift+O)
What is shortcut key to do same in Android Studio?
Simple, right click on your project in Android Studio, then click on the Optimize Imports that should work.
To do same thing which I described above, you can do same just pressing Ctrl+Alt+O, it will optimize imports of your current file and your entire project depends on your selection in a dialog.
I think Ctrl + Alt + O works when the import is unused but a valid import. However, say you try to import a class from a package that does not exist or no longer exists (which can happen during refactoring), the shortcut command does not work (atleast it didn't for me). If you have more than one file like this, things can get problematic.
To solve this problem, click on Analyse -> Inspect code -> (select your module / project). Let it perform the analysis. Go down to Imports -> Unused imports. Click on the "Delete unnecessary import" button that appears on the right.
Ctrl + Alt + o
- onmyway133