I have a game activity in which i have a dialog which is created in
the onCreateDialog method of the activity:

        case VICTORY_DIALOG:

                                String[] items={"Next Level", "Play Again", 
"Exit"};

                                AlertDialog.Builder builder = new 
AlertDialog.Builder(this);
                                builder.setMessage("You won!")
                                .setCancelable(false)
                                .setItems(items, new 
DialogInterface.OnClickListener() {
                                        public void onClick(DialogInterface 
dialog, int id) {
                                                if(id==0) {
                                                        
SpaceWarsActivity.this.nextLevel();
                                                } else if(id==1) {
                                                        
SpaceWarsActivity.this.loadGame();
                                                } else if(id==2) {
                                                        
SpaceWarsActivity.this.onFinishGame();
                                                }
                                        }
                                });
                                dialog=builder.create();
                                break;


When the game ends i open this dialog from the game thread (not the ui
thread) with the following code:

                                                activity.runOnUiThread(new 
Runnable() {
                                                        public void run() {
                                                                
activity.showDialog(VICTORY_DIALOG);
                                                        }
                                                });

However... the dialog is just a small empty rectangle. No title, no
items, nothing!
The buttons (setPositiveButton,setNegativeButton,setNeutralButton) are
working though.

Wat am i doing wrong?

Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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