no dude

i have tried this


zipCodeText.setOnKeyListener(new View.OnKeyListener() {
                        public boolean onKey(View arg0View,int d,KeyEvent 
keyEvent) {
                                Log.d("hey","pressed " + keyEvent.getKeyCode());

                                if(keyEvent.getAction() == KeyEvent.ACTION_DOWN)
{

                                        if (zipCodeText.getText() != null
                                                        && 
!zipCodeText.getText().toString().equals("")) {
                                                String  zipCode= 
zipCodeText.getText().toString();
                                                if( keyEvent.getKeyCode()==64) {
                                                Log.d("hey","pressed " + 
keyEvent.getKeyCode());
                                                                submitRequest();
                                                }
                                                if( keyEvent.getKeyCode()==58 
|| keyEvent.getKeyCode()==68) {
                                        return true;
                                                }

                                                if( 
zipCode.toCharArray().length>=14 && isShown) {
                                                        isShown = false;
                                                        return true;
                                                }

                                                if( 
zipCode.toCharArray().length<=12 && !isShown) {
                                                        isShown = true;
                                                        return false;
                                                }

                                                if 
(zipCode.toCharArray().length>=13 && keyEvent.getKeyCode()>=7
&& keyEvent.getKeyCode()<=16) {
                                                        if (isShown) {
                                                                isShown = false;
                                                                
Alert.getAlertIntance().showAlertBuilder(AddZipCode.this,
"ZipCode",
                                                                                
R.drawable.rivepoint_application_icon,
                                                                                
"Field Full!", "OK", false, null,
                                                                                
new DialogInterface.OnClickListener() {
                                                                                
        public void onClick(DialogInterface dialog,
                                                                                
                        int whichButton) {

                                                                                
        }
                                                                                
});
                                                        }

                                                        return true;

                                                }

                                        }
                                }

                                return false;
                        }
                });


but problem is that it shows lot of alertbox whenever i tried to put
more charactars

how can i check if alertbox is already there?

On May 2, 7:30 pm, 6real <[EMAIL PROTECTED]> wrote:
> You seem in a hurry (!)
>
> OK so actually I don't have the javadoc under my eyes but here are
> some clues :
> 1 - add a listener on you textview (on change listener or seomething
> like that)
> 2 - in the onChange() (or similar)  check the lenth of the text of
> yourt text view.
> 3 - if it is greater than "n" then AlertDialog.show (.... see javadocs
> for 
> params...)http://code.google.com/android/reference/android/app/AlertDialog.html
>
> I hope it gives you the first steps
>
> C.
>
> On May 2, 4:23 pm, Greg <[EMAIL PROTECTED]> wrote:
>
> > heloooooooooooooooooooooo
>
> > On May 2, 7:19 pm, Greg <[EMAIL PROTECTED]> wrote:
>
> > > hello any body can help me ?
>
> > > On May 2, 7:05 pm, Greg <[EMAIL PROTECTED]> wrote:
>
> > > > I want to show a alert box if user type more than 13 charactars in
> > > > EditText
>
> > > > how can i do that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to