【发布时间】:2010-08-11 16:03:05
【问题描述】:
我想创建一个简单的应用程序,在 android 的全局快速搜索框中显示信息。
我确实遵循了一些操作方法,但我无法在“设置->搜索->可搜索项目”菜单中获取我的应用程序,该菜单可让用户在 QSB 中检查他想要哪些建议。
我可以在此处附上清单和可搜索的 xml 文件..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.andreabaccega.marketsearch" android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Init" android:label="LUPO">
<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" />
</activity>
<provider android:name="com.andreabaccega.marketsearch.SuggestionProvider"
android:authorities="com.andreabaccega.marketsearch.SuggestionProvider" android:syncable="false"/>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
这是 searchable.xml 文件
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="Teasdst"
android:searchSettingsDescription="asd asd asd"
android:includeInGlobalSearch="true"
android:searchSuggestAuthority="com.andreabaccega.marketsearch.SuggestionProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://com.andreabaccega.marketsearch.SuggestionProvider/"
>
</searchable>
【问题讨论】:
标签: android