views:

58

answers:

1

I was the Android Developer article on Search: http://developer.android.com/guide/topics/search/index.html and was wondering if I could add other UI Elements to the searchable.xml file? Here is what I want to do:

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/app_name" >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="System:"/>
    <Gallery
    android:id="@+id/gallery"
    android:layout_width="fill_parent"
    android:layout_height="52px"
    android:padding="8px"
    android:unselectedAlpha="0.5"
    android:spacing="3px">
    </Gallery>
</searchable>

I wan to provide the gallery as a way to specify what category to search in. Is this possible? If it is, how and where do I access the the user selection for this component? If not, how else might I implement giving a choice to the user to search more specifically?

+1  A: 

I wan to provide the gallery as a way to specify what category to search in. Is this possible?

Not through standard Android search.

If not, how else might I implement giving a choice to the user to search more specifically?

Implement two search mechanisms. One is launched from your app when you want (search button, menu choice, etc.) and looks however you want, including the category selection. The other is the searchable.xml mechanism for integrating with Android's built-in search, in which case you are limited to their search UI and searching on keywords only.

CommonsWare