您好,我使用的是 android 3.0搜索小部件(不是搜索模式),问题是我需要将一些参数与搜索词一起传递。
Android 没有调用这些
searchManager.setOnDismissListener( new OnDismissListener() {
@Override
public void onDismiss() {
// TODO Auto-generated method stub
Log.v(MyApp.TAG, "on dismiss search");
}
});
searchManager.setOnCancelListener( new OnCancelListener() {
@Override
public void onCancel() {
// TODO Auto-generated method stub
Log.v(MyApp.TAG, "on dismiss cancel");
}
});
@Override
public boolean onSearchRequested() {
Bundle appData = new Bundle();
appData.putLong("listino_id", this.listino_id);
this.startSearch(null, true, appData, false);
return true;
// return super.onSearchRequested();
}
我需要我的活动不是singleOnTop,这是我的 AndroidManifest.xml
<activity android:name=".activity.ListinoProdottiActivity" android:windowSoftInputMode="stateHidden">
<!-- Receives the search request. -->
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<!-- No category needed, because the Intent will specify this class component-->
</intent-filter>
<!-- enable the base activity to send searches to itself -->
<meta-data android:name="android.app.default_searchable"
android:value=".activity.ListinoProdottiActivity" />
<!-- Points to searchable meta data. -->
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
这是我的 searchable.xml
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
/>