You can do the same in either of the ways By using addTextChangeListiner or by defining your own function and check the validation when ever user try to access the Edittext input
check the following links for more details. http://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener%28android.text.TextWatcher%29 http://stackoverflow.com/questions/4283062/textwatcher-for-more-than-one-edittext http://stackoverflow.com/questions/6119722/how-to-check-edittexts-text-is-email-address-or-not Regards Vinay Kumar On Thu, Aug 30, 2012 at 10:21 AM, Sadhna Upadhyay <sadhna.braah...@gmail.com > wrote: > Hi everybode, > > please tell me how to apply validation on edit text box,for > email,numeric,phon num etc/ > > i have this link but dont know how to implement how to compare wuth > edittext > > this is link,but dont know how to implement.pls help me > > public boolean validateEmail(String email) { > > Pattern pattern; > Matcher matcher; > > String EMAIL_PATTERN = > "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; > > pattern = Pattern.compile(EMAIL_PATTERN); > > matcher = pattern.matcher(email); > > return matcher.matches(); > > } > > > > -- > 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 > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en