android中searchable的施用
android中searchable的使用
//seachable.xml: <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/search_title" android:includeInGlobalSearch="true" android:searchSuggestAuthority="media" android:searchSuggestPath="external/audio/search" android:searchSuggestThreshold="3" android:searchSuggestIntentAction="android.intent.action.VIEW" android:searchSettingsDescription="@string/search_settings_description" /> //响应的QueryBrowserActivity: //在oncreate方法里面设置了隐藏软键盘。(会不会这地方设置不正确呢?) InputMethodManager manager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); manager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_NOT_ALWAYS); //AndroidManifest.xml文件中也没有进行特殊设置: <activity android:name="QueryBrowserActivity" android:windowSoftInputMode="adjustPan" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.MEDIA_SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity>