Android studio怎么设置自动导入需要的包

如题所述

很多同学在使用Android Studio的时候会发现不进行设置的话它不能自动的导入一些包名,当然有快捷键Alter + enter键但是只能导入一个。所以本经验将教大家如何设置Android Studio来自动导入包名。 

    首先我们打开我们下载安装好的Android Studio,如下图所示:

    2

    然后我们,单击上面的设置按钮也就是上面的小扳手

    3

    打开后我们选择editor-->autoimport.如下图所示:

    4

    然后我们注意包右侧的几个选项选上,然后点击确定:

    5

    点击确定之后我们可以写入代码看看,我们可以看到一些类和包名会自动导入进去:

    6

    最后我们就可以愉快的编写代码了,当然我们如果要取消设置只要把前面设置的选项去掉就好了

温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-10-21

Android Studio设置自动导入包的步骤:

    依次点击File->Setting->Editor。


    选择右边窗口的“general”选项,然后选择Auto Import。


    这时右边的窗口就是显示对于自动导包的设置,把optimize imports on the fly和add unambiguous imports on the fly勾选上,点击OK即可

第2个回答  2016-10-17
This problem can be said is unprecedented. No latecomers, answer the Chinese civilization for five thousand years, every year have a explain yourself, then later overturned, re established, so repeatedly complex for thousands of years, you are so lucky, today, I can tell you a standard answers, at least 5000 years won't be overthrown, that card is the kingly way.

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网