How about extending DatePickerDialog
and adding a setPermanentTitle
method to store a permanent title that will be forced when date gets changed ?
public class MyDatePickerDialog extends DatePickerDialog {
private CharSequence title;
public MyDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
super(context, callBack, year, monthOfYear, dayOfMonth);
}
public void setPermanentTitle(CharSequence title) {
this.title = title;
setTitle(title);
}
@Override
public void onDateChanged(DatePicker view, int year, int month, int day) {
super.onDateChanged(view, year, month, day);
setTitle(title);
}
}
And then use the new setPermanentTitle
method:
MyDatePickerDialog dpd = new MyDatePickerDialog(this, null, 2012, 10, 10);
dpd.setPermanentTitle("set date");
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…