Question

I'm debugging SearchableDictionary sample on android 4.0. In searchable.xml, what does question mark signify in this attribute, android:searchSuggestSelection=" ?"?

Here is the snippet :

<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="com.example.android.searchabledict.DictionaryProvider"
    android:searchSuggestIntentAction="android.intent.action.VIEW"
    android:searchSuggestIntentData="content://com.example.android.searchabledict.DictionaryProvider/dictionary"
    android:searchSuggestSelection=" ?"   
    android:searchSuggestThreshold="1"
    android:includeInGlobalSearch="true"
    >

Thanks.

Was it helpful?

Solution

It stands for the query typed by the user. See the docs

android:searchSuggestSelection [String]

This value is passed into your query function as the selection parameter. Typically this is a WHERE clause for your database, and should contain a single question mark, which is a placeholder for the actual query string that has been typed by the user (for example, "query=?").

Alternate

android:searchSuggestSelection="word MATCH ?"

OTHER TIPS

also had a problem on this one, SearchableDictionary sample. cannot find the Resource folder because R.java is not generated which is probably the same problem you were experiencing that's why your debugging the XMLs. this is the solution that worked for me. link

  1. Right-click on your project
  2. Choose Properties
  3. Choose Android in the left menu
  4. Tick a box next to the appropriate Project Build Target.*****
  5. Click Apply and OK

My additional instructions: *****Choose build higher than API 10 or starting from API 11. If you choose lower than 11 you will still get the error. This worked for me. tried most of the suggestions ahead of this. finally solved it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top