Friday, October 22, 2010

[android-developers] Searchable dictionary results are not being shown in global search

Hello,

I have tried to implement the searchable dictionary sample app.
Everything seems to be working except when I try to pull the results
from global search.
I have tried to follow everything that has been described in the docs
too.

My searchable.xml
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/search_label"
android:hint="@string/search_hint"
android:searchSettingsDescription="@string/
settings_description"

android:searchSuggestAuthority="sd2.com.achie.DictionaryProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://
sd2.com.achie.DictionaryProvider/dictionary"
android:searchSuggestSelection=" ?"
android:searchSuggestThreshold="1"
android:includeInGlobalSearch="true"
>
</searchable>

And the authorities, mime types

public static String AUTHORITY =
"sd2.com.achie.DictionaryProvider";
public static final Uri CONTENT_URI = Uri.parse("content://" +
AUTHORITY + "/dictionary");

public static final String WORDS_MIME_TYPE =
ContentResolver.CURSOR_DIR_BASE_TYPE +"/vnd.sd2.com.achie";
public static final String DEFINITION_MIME_TYPE =
ContentResolver.CURSOR_ITEM_BASE_TYPE +"/vnd.sd2.com.achie";

My Manifest is

<application android:icon="@drawable/ic_dictionary"
android:label="@string/app_name">
<activity android:name=".SearchableDictionary"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- 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>

<!-- Points to searchable meta data. -->
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" /
>

</activity>
<!-- Displays the definition of a word. -->
<activity android:name=".WordActivity"
android:theme="@android:style/Theme.NoTitleBar" />

<!-- Provides search suggestions for words and their
definitions. -->
<provider android:name=".DictionaryProvider"

android:authorities="sd2.com.achie.DictionaryProvider" />

<!-- Points to searchable activity so the whole app can invoke
search. -->
<meta-data android:name="android.app.default_searchable"
android:value=".SearchableDictionary" />
</application>

What might be the problem?

Thank you,
Achie

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate