android studio 立即删除我的副本 &粘贴导入语句 [英] the android studio instantly remove my copy & paste import statement
问题描述
我有一个由 android studio 0.8x 设置的项目(空白活动),但是当我粘贴(ctrl + v)一些如下的导入语句时
i've a project (blank activity) set up by android studio 0.8x, but when i paste (ctrl + v) some import statement like the following
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.TransitionDrawable;
import android.os.Bundle;
import android.widget.ImageView;
android studio 会自动回滚(ctrl + z),只有默认的import语句会保留,所以我现在不能使用任何自定义的import语句,这是怎么回事?
the android studio will automatically rollback (ctrl + z) and only default import statement will stay, so i can't use any custom import statement now, what the matter is going on?
推荐答案
您可以在设置"、编辑器"、自动导入"中控制行为.这是即时优化导入"设置
You can control the behaviour in Settings, Editor, Auto-Import. It is the "optimize imports on the fly" setting
但是,我建议您开始编写代码,Android Studio 会突出显示您尚未导入的类,然后您只需键入 Alt+Enter 即可添加必要的导入
However, I would recommend to start writing your code, Android Studio will highlight the classes you have not yet imported and then you can add the necessary imports by simply typing Alt+Enter
这篇关于android studio 立即删除我的副本 &粘贴导入语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!