自动导入不适用于 Android Studio 中的 Android 类 [英] Auto import not working for Android classes in Android studio

查看:27
本文介绍了自动导入不适用于 Android Studio 中的 Android 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Android Studio 中进行一个项目.突然,自动导入在 android studio 中停止工作,用于 Android 类,如 Android.widgets.Textview 等.在我的设置中,启用了自动导入.如果我编写 import android.widget.textview,则 TextView 会显示在自动导入框中.

I am working on a project in Android studio. Suddenly, auto import stopped working in android studio for Android classes, like Android.widgets.Textview, etc. In my settings, auto import is enabled. If I write import android.widget.textview, then TextView shows up in the auto import box.

推荐答案

问题出在 android studio 索引上.

The problem was with android studio indexing.

按照步骤..

转到文件">使缓存无效/重新启动"

Go to 'File' > 'Invalidate caches/restart'

现在工作室将关闭并重新启动.现在开始索引.完成索引后,您将找到包含所有可能建议的建议框.

Now the studio will shut down and restart. Now indexing begins. On completion of indexing you will find the Suggestion boxes with every possible suggestions.

这篇关于自动导入不适用于 Android Studio 中的 Android 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆