如何在Android Quick Search Box中添加自己的app,按照我的意愿去Search(转载)??????view plaincopy to cli
如何在Android Quick Search Box中添加自己的app,按照我的意愿去Search(转载)
??????view plaincopy to clipboardprint?
- <intent-filter>??
- ????<action?android:name="android.intent.action.SEARCH"?/>??
- ????<category?android:name="android.intent.category.DEFAULT"?/>??
- </intent-filter>??
- ??????????????
- <meta-data?android:name="android.app.searchable"??
- ???????android:resource="@xml/searchable"?/>??
?
???? 还需要公开自己的数据,供Quick Search Box 使用
?
view plaincopy to clipboardprint?- <!--?Provides?search?suggestions?for?words?and?their?definitions.?-->??
- <provider?android:name="DictionaryProvider"??
- ???????android:authorities="dictionary"??
- ???????android:syncable="false"?/>??
?
???? 在res/xml/searchable.xml中,要注意searchSuggestAuthority和AndroidManifest.xml中的要对应上,
?
view plaincopy to clipboardprint?- <searchable?xmlns:android="http://schemas.android.com/apk/res/android"??
- ???????android:label="@string/search_label"??
- ???????android:searchSettingsDescription="@string/settings_description"??
- ???????android:includeInGlobalSearch="true"??
- ???????android:searchSuggestAuthority="dictionary"??
- ???????android:searchSuggestIntentAction="android.intent.action.VIEW">??
- </searchable>??
?
???编译生成apk推入,先在Search setting中手动勾选上自己的应用选项,就可以了。
?? 在package/apps/QuickSearchBox/tests/下,还有三个有意思的app,可以直接添加到QuickSearchBox中。
? ? To run the tests use the command:
??? "adb shell am instrument -w com.android.quicksearchbox.tests/android.test.InstrumentationTestRunner"
转载:http://blog.csdn.net/yiyaaixuexi/archive/2011/03/02/6218823.aspx ?
?? 丰富一下QSB吧~
?
?
