KeyListener not working as expected

by MB » Wed, 14 Apr 2010 03:03:50 GMT


Sponsored Links
 Hello All,
I am trying to implement a basic program.

I have a EditText view, and want to set a KeyListener to it.

Here is the code below.

myText.setOnKeyListener(new View.OnKeyListener() {
           public boolean onKey(View view,int keyCode,KeyEvent ke)
{
                        Log.d(TAG,nto on key;
               return true;
            }
});

As it is returning true, the onKey method is called for all keys from
keyboard on screen, but the typed text does not appear on the EditText
view.

If I return false, the onKey method is called for only meta keys like
Backspace (keyboard on screen),and the typed text does appear on the
EditText view.

I want to typed text on the EditText view, and work for all keys from
keyboard on screen(default Qwerty keyboard).

Where am I making mistake.

Could anyone pls let me know.

Thanks,
MB

--



Other Threads

1. 3.0 Preview SDK won't install

When I try to install the Honeycomb preview using the SDK & AVD
Manager, I get this error:

File not found: 
https://dl-ssl.google.com/android/repository/android-3.0_pre_r01-linux.zip

Anyone have a work around?

Thanks,
--
Darren

-- 

2. HTC Desire crashed, deleted all SMS. Can I recover?

Hi All,

Been a reader of the group for a while as am getting into Android
development. Just wanted to ask a quick question. Hope someone can
help. :)

I have a HTC desire (2.2 with HTC sense, as per stock), never rooted
and little used (basic apps installed, not used for any dev) I use as
just a phone really. Hence I was very surprised when it crashed the
other day and all my SMS/MMS were deleted (the stock HTC Messages app
was empty)!

I know I should not have rebooted the device (as file recovery may be
easier as it reduces chances of file space being overwritten), but was
told to do so by TMobile advisor.

Upon reboot, found the stock HTC Messages app used for SMS/MMS was was
now populated by SMS that was saved on the SIM. Hence I think, the
Desire recreated the SMS/MMS content using the saved SIM messages as a
start.

What I would like to know is can the older SMS/MMS be recovered? I
assume they are stored in...
/data/data/com.android.providers.telephony/databases/smsmms.db
...and that this file (originally with 500+ messages) has been
overwritten by a new smsmms.db (now containing ~5 messages), but as I
am new to Android/Linux am not sure if this assumption is right e.g.
the new smsmms.db file could be written to a different disk location
(as is commin on FAT32/NTFS file systems in Windows) and hence with
the right know-how the original file can be recovered (I've recvered
many files like this in Windows without issue).

Does anyone know how to recover SMS/MMS messages like that, or how to
recover/undelete files from these devices in general (I don't mind if
it is only a partial file and I have to rebuild/extract messages).

Thanks :)

-- 

3. Android workshops for developers. Any suggestions?

4. TableRows doesn't display

5. Is this possible with Android

6. is there anyway to force locale system numeric to English ?

7. how can i make non-sqlite cursor?