Hihi,
you found about how to use if the user entered information in some
field and it doesn't validate
you show dailog.
But I want to correct method you have used.
you should method show().
V.Nhan.
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!!
}
}).show();
On Jan 26, 11:31 am, Juan David Trujillo C.
jdavidandr...@gmail.com wrote:
In case this is useful, I found it:
You can't use a regulardialogwith the possitive and negative
buttons, what you have to do is to create the buttons inside the UI of
thedialogyou want toshowand then add regular listeners to this
buttons. When you want to hide thedialog, all you have to do is ues
the cancel() method on thedialogand that's it.
Juan.
On Jan 25, 1:11 pm, Juan David Trujillo C. jdavidandr...@gmail.com
wrote:
Hi guys!
I have anactivitythat shows adialogthat 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 toshowadialogwith an appropiate message ontopof the
aforementioneddialog. However I haven't been able to do so, because
once I write code on the onClick(DialogInterfacedialog, int
whichButton) of the firstdialog, thisdialogcloses and doesn't stay
in the screen.
Am I missing something?
Here's what I have:
protectedDialogonCreateDialog(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(DialogInterfacedialog, int
whichButton) {
if (!validInformation()) // Validates if the
user entered or not information
//Here's where I would like
toshowanotherdialog!!
}
}).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
-~--~~~~--~~--~--~---