tags:

views:

94

answers:

1

I'm trying to port one of my iPhone apps over to the Android. It was all going along swimmingly until I came to AlertDialogs. In the iPhone app, sometimes there will be more than one alert to pass to the user. When this happens, the first alert dialog will come up, and when they click it away the next one will come up. I can't seem to get more than one dialog box to come up like that in Android. Is it possible to display back to back AlertDialogs where a second one pops up as soon as the first is finished?

A: 

You execute 2 consecutive call to 'showDialog()' after eachother and the second will show after the 1st was dismissed:

showDialog(FIRST_DIALOG_ID);
showDialog(SECOND_DIALOG_ID);

Ofcourse you also have to implement onCreateDialog().

MrSnowflake
Thanks. I ended up working around it by putting the second dialog in another activity and loading that when the first was closed, but I'll keep that in mind if the situation comes up again.
John
Multiple Activities for multiple (Alert)Dialogs? That seems a big strain (memory, loading, cpu, ...) for such a simple task.You could also implement your own queue for displaying dialogs.
MrSnowflake