我正试图开展两种不同的可搜索活动,一种是用于蜂蜜(有搜索植被)和其他用于非蜂蜜comb(有搜索诊断)的活动。
我的马尼费斯希望:
<activity android:name=".activities.Search"
android:theme="@style/NoTitleTheme"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTop">
android:enabled="@bool/disableForNonHoneycomb"
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"
android:value=".activities.Search"/>
</activity>
<activity android:name=".activities.SearchHoneycomb"
android:theme="@style/CustomTheme"
android:configChanges="orientation|keyboardHidden"
android:enabled="@bool/enableForNonHoneycomb"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"
android:value=".activities.SearchHoneycomb"/>
</activity>
And, I use following code to get the searchable configuration and set up the search view in my activity.
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
_searchView = (SearchView) mCustomView.findViewById(R.id.action_bar_searchwidget);
_searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
问题在于,当我使用植被时,它不会开始搜捕活动。 我如何做这项工作?
感谢。