我尝试使用android studio将searchview添加到我的Android应用程序中,但是当我第一次添加searchable.xml配置文件时,我收到此错误
the fallowing classes could not be found: -searchable (fix build path,edit xml) and layout missing attributes
当我构建项目时,我收到此错误:
-no resource found that matches the given name(at 'resource' with value @searchable.xml)
-execution failed for task ':app.processDebugProcess'
任何帮助??
enter code here<?xml version="1.0" encoding="utf-8"?>
android:label="@string/search_label"
android:hint="@string/hint_search"
/>
答案 0 :(得分:2)
searchable.xml 文件应位于 res / xml 文件夹中,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/hint_search"
android:label="@string/search_label" >
</searchable>