How to auto import the necessary classes in Android Studio with shortcut?

后端 未结 8 2175
抹茶落季
抹茶落季 2020-11-29 00:58

I\'ve just switch to Android Studio 0.5.1, and the things going so slow here, because nothing works in the regular way...

How do I import the necessary classes with

相关标签:
8条回答
  • 2020-11-29 00:59

    To import classes on the fly :

    On OSX press Alt(Option) + Enter.

    0 讨论(0)
  • 2020-11-29 01:00

    You can also use Eclipse's keyboard shortcuts: just go on preferences > keymap and choose Eclipse from the drop-down menu. And all your Eclipse shortcuts will be used in here.

    0 讨论(0)
  • 2020-11-29 01:04

    Go on the missing declaration with cursor and press alt+enter enter image description here

    0 讨论(0)
  • 2020-11-29 01:06

    Ctrl + Alt + O to optimize imports

    0 讨论(0)
  • 2020-11-29 01:08

    On my Mac Auto import option was not showing it was initially hidden

    Android studio ->Preferences->editor->General->Auto Import
    

    and then typed in searched field auto then auto import option appeared. And now auto import option is now always shown as default in Editor->General. hopefully this option will also help others. See attached screenshot

    0 讨论(0)
  • 2020-11-29 01:12

    On Windows with Android Studio 1.5.1 : File --> Settings --> Editor --> General --> Auto Import

    0 讨论(0)
提交回复
热议问题