2011-10-21 153 views
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; 
    } 

我在這裏丟失了什麼嗎?該對話框根本不顯示。自定義對話框不顯示

+0

任何調試消息? –

+0

不幸的是,沒有。我用調試器完成了它,程序實際上並沒有崩潰。它從showDialog返回就好了。該對話框不顯示。 – ShrimpCrackers

回答