java - How Do I keep an AlertDialog box open if a user types invalid data in Edittext? -


I have an alert dialog box that asks the user to enter their full name and email, to validate the data And if the data is invalid, then I would like to show the dialog box again with an error message (like you do with the edited field in Android). How do I do this right under the button? Here is my code:

  the ultimate alert DLOgh. Builder ZoomDialog = New AlertDialog Builder (new referenceThe theme (activity, android.R.style.Theme_DeviceDefault_Light_Dialog)); LayoutInflator Factory = LayoutInflator. (Activity); Last scene f = factory. In flat (R.List.name_name_amam, empty); ZoomDialog.setTitle ("Please enter your name and email"); ZoomDialog.setView (f); zoomDialog.setPositiveButton ( "SUBMIT", new DialogInterface.OnClickListener () {public void onClick (DialogInterface dlg, which integer) {((onFollowedListener) activity) .onFollowed (); EditText FULL_NAME = (EditText) f.findViewById (R.id .follower_name); EditText EMAIL_ADDRESS = (EditText) f.findViewById (R.id.follower_email) ;. string follower_name = full_name.getText () toString (); string follower_email = email_address.getText () toString () ;. verifier verifier = new verifier (); if (validator.validateFullName (follower_name) & amp; & amp; validator.validateEmail (follower_email)) {Toast.makeText (activity follower_name + "" + follower_email, Toast.LENGTH_LONG) .show ();} else {Full_name.setError ("** Re-quired: Please enter your name and e El Enter "); Full_namekrequestFocus (); toast. Mektekst (activity," Please enter your name and email! "Toast. Elananacac_eloji). Show (); return;} means intended = new Intent (activity, Reverse activity class); intent.putExtra ("type", "followers"); StartActivity; }}); ZoomDialog.show ();  

Every time I click the Submit (Positive) button, the dialog box is dismissed. I would like to keep it open so that users can re-enter the required information instead of returning to that place.

If I can say Show () method in the second section, then it will be easy, but it does not work!

Any help would be highly appreciated. thank you in advanced.

I recommend creating a custom dialog with the edit text and buttons that you can use on your on -Click can register. And what you want to do before sacking it,


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -