Filter-Search Applications

by friedger » Fri, 12 Sep 2008 16:46:57 GMT


Sponsored Links
 Hi,

I try to add filter search to my application, query search works fine.
I can type in a search term press enter and the result is presented.
However, I don't get a new intent when I change the search term.

(from doc of SearchManager: You will receive a new ACTION_SEARCH
Intent each time the user enters or changes the search text. You must
receive and handle these new intents by overriding onNewIntent.)

I added the filterMode bit but nothing happens. What else do I have to
do in order to enable filter search?

Here is my
search xml:

<searchable xmlns:android=" http://schemas.android.com/apk/res/android" ;
     android:label="@string/app_name"
     android:hint="@string/searchhint"
     android:icon="@drawable/application001a"
     android:searchMode="filterMode|filterModeQuickStart|
showSearchLabelAsBadge">
 </searchable>


and the manifest xml:

<activity android:name=".MainActivity"
                                        android:label="@string/app_name"
                                        android:icon="@drawable/application001a"
                >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="org.openintents.category.MAIN" />
            </intent-filter>

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


Cheers,
Friedger
--~--~---------~--~----~------------~-------~--~----~



Filter-Search Applications

by friedger » Sat, 13 Sep 2008 03:45:04 GMT


 Has anyone experience with filter search?
Friedger



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Filter-Search Applications

by Andrew Stadler » Sat, 13 Sep 2008 09:07:42 GMT


 nfortunately, Filter search (as defined in the SearchManager
documentation) is no longer supported, but the changes did not make it
into the 0.9 SDK documentation. The updated documentation will be
available in the next SDK release.

If you would like to support live (filter-as-you-type) search, there
are now two alternatives available (and these *are* available in the
0.9 SDK).

* If you wish to filter the data displayed in a local presentation,
say in a ListView, you'll want to look into using
android.widget.Filter, which can be applied to any of the classes that
implement android.widget.Filterable.

* If you wish to use the SearchManager UI, you can implement a
Suggestions Provider which provides a list of potential answers as the
user types. This UI is often used to display a filtered list of
recent search queries, but you could also use it to display a filtered
list of actual results.

Regarding what you are seeing on your application, if you wish to use
the Search Manager, I would suggest removing the filtering mode
flag(s) and see if normal query search is working for you.

Apologies for any confusion with the older documentation.

--Andy
(Google engineer)


On Fri, Sep 12, 2008 at 1:46 AM, friedger <[EMAIL PROTECTED]> wrote:

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Handling only one of a stream of trackball events

Hi,

I would like my app to change page if the trackball is moved to the
right/left.  This works but unfortunately the app is sent a stream of
trackball events and changes several pages instead of just 1.

Is there a way to handle just the first of a stream of track ball
events if the user moves the trackball right or left.

Here is the code I currently use:

        @Override
        public boolean onTrackballEvent(MotionEvent event) {
                boolean isHandled = false;
                try {
                        switch (event.getAction()) {
                                case MotionEvent.ACTION_MOVE: {
                                        float currentX = event.getX();
                                        if (currentX < -0.5) {
                                                
CurrentPassage.getInstance().previousChapter();
                                                isHandled = true;
                                        } else if (currentX > 0.5) {
                                                
CurrentPassage.getInstance().nextChapter();
                                                isHandled = true;
                                        }
                                        break;
                                }
                        }
                        if (!isHandled) {
                                isHandled = super.onTrackballEvent(event);
                        }
                } catch (Exception e) {
                        Log.e(TAG, "Error changing page", e);
                }
                return isHandled;
        }

Thanks
Martin

-- 

2. time.format() bug on real device ?

In this function:

public String millisec2duration(int millisec)
        {
                final int MILLIS = 1000;
                Time time = new Time();
                time.set(millisec * MILLIS);
                return time.format("%H:%M:%S");
        }

millisec2duration(0); returns "00:00:00" on Emulator but returns
"01:00:00" on real device.

---
Here is the "bugfix-function for the real device"

public String millisec2duration(int millisec)
        {
                final int MILLIS = 1000;
                Time time = new Time();
                millisec = millisec - 3600;
                time.set(millisec * MILLIS);
                return time.format("%H:%M:%S");
        }

which returns "00:00:00" on real device, but "23:00:00" on emulator.

Device is Samsung I5700

-- 

3. NewsDroid Tutorial

4. Getting adb to recognize a Motorola Droid on Arch Linux

5. Reason for Monkey crash

6. abort()-ing HttpGet requests in ThreadSafeClientConnManager

7. child activity does not "finish()" correctly