user1428323
user1428323

Reputation: 41

Rename default button in the Date Picker(android)

How i can rename default button("SET") in the DatePicker dialog?

My dialog:

case IDD_SET_NAME:
final Calendar c = Calendar.getInstance();
myYear = c.get(Calendar.YEAR);
myMonth = c.get(Calendar.MONTH);
myDay = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog DatePicker = new DatePickerDialog(this, myCallBack, myYear, myMonth, myDay);
return DatePicker;

Upvotes: 2

Views: 1341

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132972

You can change DatePickerDialog Set button text as:

DatePickerDialog datePicker = new DatePickerDialog(this, myCallBack, myYear, myMonth, myDay);
datePicker.setButton(DatePickerDialog.BUTTON_POSITIVE, "Enter text here", datePicker);

Upvotes: 1

Related Questions