I guess I'm answering myself again. *** And a question below.

First to get this out of the way: Suppressing the quick search box
works as before. Catch keyCode == KEY_SEARCH and return true; in the
overriden onKeyDown() or onKeyUp()

I got confused here for a while by the following problem:
Following the release notes I switched from overriding onKeyDown() to
onKeyUp() to call the desired functionality for all buttons with
alternate action. In my case, this includes BACK.
There's  a problem with _BACK however. With the physical keyboard on
an Ion running 1.6, onKeyUp() is being dispatched to the activity that
BACK returns to (one back in the call stack). That of course leads to
the unintended result of executing BACK there, now that onKeyUp() is
used to execute the alternative action of the BACK key. That, I
suppose, is behind the pattern in the release notes (http://
developer.android.com/intl/zh-TW/sdk/android-2.0.html),
using .startTracking() and a couple of additional, new methods. The
problem with this: This is 2.0 only, i.e. not backwards compatible,
and the following advice is to hack something together so the "legacy"
application (as the release notes so delicately put it) can function
on both 1.x and 2.0 devices. With no chance to test this on 2.0
without a new device that uses soft keys, I suppose. (Have had that
before)

Let me propose a much simpler approach: ***** Is it possible for an
app to query whether key events are issued in a key-down/key-up pair,
or key-up only? With such a switch it should be much simpler: Just
execute the alternative action following a key down for the variant
key-down/key-up versus following a key up.





On Oct 29, 10:05 pm, JP <[email protected]> wrote:
> One of my apps implements a search function which is invoked when the
> user presses the Search button.
> In 1.6, Android Quick Search Box can be suppressed by overriding
> Activity.onKeyDown() and picking out KEY_SEARCH.
> On Android 2.0, no more... Android's Quick Search pops up no matter
> whether Activity.onKeyDown(), Activity.onKeyUp() is overridden, or
> Activity.setDefaultKey(DEFAULT_KEYS_DISABLE) is set.
>
> Has anybody had any luck getting rid of the Android Quick Search?

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

Reply via email to