tags:

views:

28

answers:

1

is there something like dialog's order in Android?

I explain what I mean.

There is a dialog builder with "OK"-Button. When user press ok, dialog will be closed.

Wenn I call more than one dialogs after each other in an activity, I see first the last one, then next to last and so on. But I would like to see first the first dialog, then the second, then ...

Is there the possibility for that?

Or is it possible not to call second dialog until first dialog isn't closed?

Mur

A: 

When you define the onClick() method for your dialog's "Ok" button (setNeutralButton()), you'll have to display the second dialog (via showDialog() or similar) and then dismiss the first dialog.

An example:

builder = new Builder(context);
builder
    .setTitle(R.string.dialog_download_failed_title)
    .setMessage(R.string.dialog_download_failed_message)
    .setCancelable(true)
    .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            showDialog(SECOND_DIALOG);
            dialog.dismiss();
        }
    });
Jason Knight
It's a solution, but it's not exactly what I need. I'll try to give my (custom) dialog builder an arraylist with messages
Mur Votema