plz visit http://developer.android.com/reference/android/text/TextWatcher.html to no more... It can be associated with an edittext as follows. yourEditText.addTextChangedListener(yourTextWatcher); then in either the aftertextchanged or ontextchanged you could show the alert.
On Thu, Jul 2, 2009 at 4:35 PM, Chris <[email protected]> wrote: > > Whats is this stuff(textwatcher) man?? > > On Jul 2, 3:48 pm, Sujay Krishna Suresh <[email protected]> > wrote: > > A simpler solution would be to implement a textwatcher. > > > > On Thu, Jul 2, 2009 at 4:12 PM, Saurav Mukherjee < > > > > > > > > > > > > [email protected]> wrote: > > > thats pretty simple. run a thread with a while(no of chars < max){} . > wen > > > it exceeds, the while stops and then send a Message to a message > handler to > > > display the dialog box. > > > > > u can get the number of chars in the thread by running a > > > handler.post(Runnable) method. > > > > > hope this help. > > > > > cheers! > > > > > On Thu, Jul 2, 2009 at 4:02 PM, Chris <[email protected] > >wrote: > > > > >> Let me tell you what i really want, actually i have to show an alert > > >> box saying "max. limit reached" when the characters limit reaches 100, > > >> so for that i need to sense the key events occured and show the alert > > >> box. As of now i am able to detect computer's keys, emulator's > > >> home,power,call,call_end,volume_up/down etc. keys. But im not able to > > >> detect the alphabet keys of softkeyboard.I need a way to capture those > > >> clicks.Anyways, thanx for ur prompt response. > > > > >> On Jul 2, 3:16 pm, Saurav Mukherjee <[email protected]> > > >> wrote: > > >> > well i have not tried capturing the keys from the soft keyboard, but > u > > >> cud > > >> > try out a round abt method for checking the number of chars > exceeded. u > > >> cud > > >> > run a thread tht keeps track of the text entered in the edit text > box. > > >> wen > > >> > it exceeds, delete from the edit text box. > > > > >> > if u have a better sol please share. > > >> > cheers! > > > > >> > On Thu, Jul 2, 2009 at 3:06 PM, Chris < > [email protected]> > > >> wrote: > > > > >> > > Hi every body > > >> > > I am popping an alert box whenever an user exceeds 100 characters > in a > > >> > > text-box(EditTextPreference). > > >> > > Now i am able to capture the hard keyboard's, i.e. computers's > > >> > > keyboard, events, but i am not able to capture the sofkeyboard's > key > > >> > > events. > > >> > > There are some keys like numbers, enter, delete etc. in the > > >> > > softkeyboard which i am able to capture using onKey, but i am not > able > > >> > > to capture the alphabets and other keys. > > >> > > i also tried setOnKeyboardActionListener, but didnt get the > desired > > >> > > results,( may be i was not using it correctly). > > >> > > Can any one suggest how to capture the click of alphabets on the > > >> > > sofkeyboard. > > > > >> > > Thanks a lot..- Hide quoted text - > > > > >> > - Show quoted text - > > > > -- > > Regards, > > Sujay > > Fred Allen <http://www.brainyquote.com/quotes/authors/f/fred_allen.html> > - > > "California is a fine place to live - if you happen to be an orange."- > Hide quoted text - > > > > - Show quoted text - > > > -- Regards, Sujay Emo Philips <http://www.brainyquote.com/quotes/authors/e/emo_philips.html> - "A computer once beat me at chess, but it was no match for me at kick boxing." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

