【问题标题】:Application non showing in global Quick Search Box应用程序未显示在全局快速搜索框中
【发布时间】: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


    【解决方案1】:

    试试这个可能有效: 在 searchable.xml 中删除字符串的任何硬编码,所有对字符串的引用都应作为@string/yourString。

    【讨论】:

    • 感谢您的提示!我刚刚调试了我的应用程序 2 小时,这就是错误的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-19
    • 1970-01-01
    相关资源
    最近更新 更多