自动导入不适用于 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.