0
showDialog( DIALOG_CREATEPC ); // called elsewhere

private Dialog addPCDialog()
{
   final Dialog dialog = new Dialog( this );

   dialog.setContentView( R.layout.party_createpc );
   dialog.setTitle( "Add PC" );
   ...
   return dialog
}

@Override
protected Dialog onCreateDialog( int id )
{       
    Dialog dialog;
        switch( id )
        {
            case DIALOG_CREATEPC:
                dialog = addPCDialog();
                break;
            default:
                dialog = null;
        }
        return dialog;
    }

我在这里错过了什么吗?对话框根本不显示。

4

1 回答 1

0

尝试覆盖onPrepareDialog而不是onCreateDialog

http://androidzteam.com/wpv/?p=44

于 2011-10-21T20:57:17.493 回答