http://code.google.com/p/android/issues/detail?id=857

This problem is because of a bug in the super class Dialog. Once I called
removeDialog before I call showDialog in my code. The problem is completely
solved. So, I am creating the dialog like this from now on:
removeDialog(R.id.display_success);
showDialog(R.id.display_success);


On Thu, May 7, 2009 at 11:16 AM, Omer Saatcioglu <[email protected]>wrote:

> Hello,
>
> Today I faced a very weird problem. In my game I create AlertDialog to
> show the user next level challenges when one is succeeded. So, the
> corresponding code is like this. when the game is succeeded showDialog
> (R.id.display_success) is called and the following code is executed.
> So, I am expecting to execute this code in every call. However; the
> game is executing only once and showing the same AlertDialog in every
> other execution. I mean, like the instance is not created after the
> first one is created and the first instance is used all the time. I
> hope I could describe my problem. Thank you.
>
>                case R.id.display_success:
>                        Log.d("GfxMasterShot::onCreateDialog", "Succcess " +
> Integer.toString(SMBGuesstheNumber.nCurrentLevel));
>                        updateGameSettings();
>                        message = formatLevel()
>                        + formatMission();
>                        return new AlertDialog.Builder(this)
>                        .setIcon(R.drawable.smiley_happy)
>                        .setTitle(R.string.dialog_success)
>                        .setMessage(message)
>                        .setPositiveButton(R.string.alert_dialog_newgame,
> new
> DialogInterface.OnClickListener() {
>                                public void onClick(DialogInterface dialog,
>     int whichButton) {
>                                        StartaNewGame();
>                                }
>                        })
>                        .setNegativeButton(R.string.exit, new
> DialogInterface.OnClickListener() {
>                                public void onClick(DialogInterface dialog,
> int whichButton) {
>
>  CtrlMaintanence.getInstance().setCurrentLevel
> (SMBGuesstheNumber.nCurrentLevel + 1);
>                                        finish();
>                                }
>                        })
>                        .create();
>
>


-- 
Omer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to