我有一個onCreateDialog設置,我需要把2個對話框(Datepicker和Timepicker),但是當我把他們倆onCreateDialog它只打開第一個Datepicker。我可以在同一個「onCreateDialog」中有2個對話框嗎?
代碼:
@Override
protected Dialog onCreateDialog(int id) {
//date picker
switch (id) {
case DATE_DIALOG_ID:
// set date picker as current date
return new DatePickerDialog(this, datePickerListener, year, month,day);
}
//time picker
switch (id) {
case TIME_DIALOG_ID:
//set time picker as current time
return new TimePickerDialog(this, timePickerListener, hour, minute,false);
}
return null;
}
顯示與呼叫者相關的代碼。 – kosa
什麼?即時通訊對不起,即時通訊新的 –