Extend DatePickerDialog and override setTitle() method.

This commit is contained in:
Miroojin Bakshi 2014-03-04 18:45:06 +05:30
parent 1613a015d6
commit 0a12c41ca9

View File

@ -114,7 +114,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
date = new GregorianCalendar(TimeZone.getTimeZone("UTC")); date = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
} }
DatePickerDialog dialog = new DatePickerDialog(getContext(), DatePickerDialog dialog = new ExpiryDatePickerDialog(getContext(),
mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH), mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH)); date.get(Calendar.DAY_OF_MONTH));
mDatePickerResultCount = 0; mDatePickerResultCount = 0;
@ -253,3 +253,14 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
} }
} }
class ExpiryDatePickerDialog extends DatePickerDialog {
public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
super(context, callBack, year, monthOfYear, dayOfMonth);
}
public void setTitle(CharSequence title) {
super.setTitle("Set date");
}
}