[android-developers] How to support Single Listener And Multiple Date-picker Dialog
Hi ,
I have 4 DatePicker Dialog in my Activity Class which are shown on
click of 4 buttons . Now for these datePickerDialog i want to use same
listener .
DatePickerDialog taxPickerDialog = new
DatePickerDialog(getCurrentContext(),dateSetListener,calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE));
taxPickerDialog.show();
DatePickerDialog fcPickerDialog = new
DatePickerDialog(getCurrentContext(),dateSetListener,calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE));
fcPickerDialog.show();
break;
DatePickerDialog expiryPickerDialog = new
DatePickerDialog(getCurrentContext(),dateSetListener,calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE));
expiryPickerDialog.show();
DatePickerDialog permitPickerDialog = new
DatePickerDialog(getCurrentContext(),dateSetListener,calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE));
permitPickerDialog.show();
Now i want a use listener for all the 4 dialog but dnot know how to
implement this ???
DatePickerDialog.OnDateSetListener dateSetListener =new
DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int
day) {
switch(????){????}
}
};
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home