I recently upgraded my app to have a minSdkVersion of 26 and all the date picker dialogs are behaving very oddly. The DatePickerDialog is displaying the monnths from the calendar in the following format: 
As you can see the months are being displayed as "M + the number of the month" (01 being January - 12 being December), how can I revert this so the date can be displayed normally again? By normally I mean Oct instead of M10
Below is the code of my date picker dialog.
public static void showDatePickerDialog(Context context, DatePickerCallback datePickerCallback) {
Calendar calendar = Calendar.getInstance();
int buttonColor = ContextCompat.getColor(context, R.color.black);
DatePickerDialog datePickerDialog = new DatePickerDialog(context, R.style.DatePickerDialogTheme, (view, year, month, dayOfMonth) -> {
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month);
calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
datePickerCallback.onDateSelected(calendar.getTime()); // the callback here is setting the date wherever we call this method
}, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
datePickerDialog.show();
datePickerDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(buttonColor);
datePickerDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(buttonColor);
}
If you want the month in string you can use this
And for the problem of M you can use a Local in your calendar instance :