tags:

views:

64

answers:

1

Hi,

I am trying to implement both the date picker and time picker. But when i try to define two cases in the following code, i get an error that Duplicate case.

enter code h@Override

protected Dialog onCreateDialog(int id) { // TODO Auto-generated method stub switch(id){ case ID_DATEPICKER: Toast.makeText(SendMail.this, "Select Appointment Date", Toast.LENGTH_LONG).show(); return new DatePickerDialog(this, myDateSetListener, myYear, myMonth, myDay); case TIME_DIALOG_ID: Toast.makeText(SendMail.this, "Select Appointment Time", Toast.LENGTH_LONG).show(); return new TimePickerDialog(this,mTimeSetListener, 0, 0, false);

 default:
 return null;

} }

Whats the solution???

A: 

make sure ID_DATEPICKER and TIME_DIALOG_ID do not have the same int value.

BrennaSoft
Thanks a lot for the 1 minute reply bro... Overlooked it...
Rahul Varma
You should mark the question as answered.
synic