In case this is useful, I found it:

You can't use a regular dialog with the possitive and negative
buttons, what you have to do is to create the buttons inside the UI of
the dialog you want to show and then add regular listeners to this
buttons.  When you want to hide the dialog, all you have to do is ues
the cancel() method on the dialog and that's it.

Juan.

On Jan 25, 1:11 pm, "Juan David Trujillo C." <jdavidandr...@gmail.com>
wrote:
> Hi guys!
>
> I have an activity that shows a dialog that has some editText fields
> the user is supposed to fill in.  I would like to validate if the user
> entered information in some fields, and in case he didn't, I would
> like to show a dialog with an appropiate message on top of the
> aforementioned dialog.  However I haven't been able to do so, because
> once I write code on the onClick(DialogInterface dialog, int
> whichButton) of the first dialog, this dialog closes and doesn't stay
> in the screen.
> Am I missing something?
>
> Here's what I have:
> protected Dialog onCreateDialog(int id) {
>     return new AlertDialog.Builder(RegisterEvent.this)
>             .setIcon(R.drawable.ico_registerevent_customization)
>             .setTitle(R.string.tv_x_customization)
>             .setView(textEntryView)
>             .setPositiveButton(R.string.tv_x_ok, new
> DialogInterface.OnClickListener() {
>                   public void onClick(DialogInterface dialog, int
> whichButton) {
>                         if (!validInformation()) // Validates if the
> user entered or not information
>                                 //Here's where I would like to show another 
> dialog!!
>                   }
>      }).create();
> Best regards,
>
> Juan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to