i am using this inputbox for asking name to the user. I need to validate that user does not enter empty string and if enters i am trying not to dismiss the dialog
http://www.anddev.org/viewtopic.php?p=12915 new AlertDialog.Builder(this) .setView(fl) .setTitle("Success !") .setPositiveButton("OK", new DialogInterface.OnClickListener() { //@Override public void onClick(DialogInterface d, int which) { // if (input.getText().toString() != null && !"".equals ( input.getText().toString() )) { String text = input.getText().toString().trim(); boolean b1 = (null == text); boolean b2 = ("" == text); boolean b3 = (0 == text.length()); if(b1 || b2 || b3) { } else { d.dismiss(); } } }).create().show(); here even if the if block is true and dismiss statement is in else, the dialog disappears ! i want to dialog remain as is [may be title says cannot be empty] and asks for a nonempty value and stay there any helps are thanked regards -- 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