大家好,我现在使用菜单项调用android搜索框架实现搜索功能,但是在点击搜索时,发现搜索框并没有显示不知道大家是否碰到过这种问题,现在贴出部分代码:onSearchRequested()方法代码 public boolean onSearchRequested() {
System.out.println(">>>>>>>>>>>. onSearchRequested is invoke!!");
startSearch("", false, null, false);
return true;
}Acitivity配置 <activity android:name=".ChatRecordActivity" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<data android:name="android.app.searchable" android:resource="@xml/searchable" />
</intent-filter>
</activity>searchable配置文件,位置在res/xml目录下面<?xml version="1.0" encoding="utf-8"?>
<searchable
xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/searchHint"
android:label="@string/searchLable"
android:searchMode="showSearchIconAsBadge"
android:searchSuggestAuthority="szu.mobiledev.SuperMessenger.SearchSuggestionSampleProvider"
android:searchSuggestSelection=" ? ">
</searchable>
System.out.println(">>>>>>>>>>>. onSearchRequested is invoke!!");
startSearch("", false, null, false);
return true;
}Acitivity配置 <activity android:name=".ChatRecordActivity" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<data android:name="android.app.searchable" android:resource="@xml/searchable" />
</intent-filter>
</activity>searchable配置文件,位置在res/xml目录下面<?xml version="1.0" encoding="utf-8"?>
<searchable
xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/searchHint"
android:label="@string/searchLable"
android:searchMode="showSearchIconAsBadge"
android:searchSuggestAuthority="szu.mobiledev.SuperMessenger.SearchSuggestionSampleProvider"
android:searchSuggestSelection=" ? ">
</searchable>
解决方案 »
- android 播放视频的疑问
- findPreference总返回空值。。。。小弟在此先感谢各位高手。。。几个小时了一直搞不出来
- 关于用Eclipse搭建Android平台的问题-错误提示PANIC: Could not open
- android怎么更改开机画面
- 有人遇到过某个Layout的背景突然消失变成透明的问题?
- 如何让某一区域变模糊
- 线程中的ui操作,获取动态时间的问题
- apk反编译后 什么都没有改 重新打包报错 求解
- Android 证书问题,求指导,万分感谢。
- android 创建桌面快捷方式,并给快捷方式传自定义参数如何实现?
- 如何让写的程序按了返回键以后,还会在后台执行?
- Android 与 C# wpf
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />