I tried some suggestion from How to change DatePicker dialog color for Android 5.0 but the only problem is next the two of the buttons are not visible as after writing the code
public static void showExpenseDate(final Context context, final EditText textView) {
final Calendar calendar = Calendar.getInstance();
int yy = calendar.get(Calendar.YEAR);
int mm = calendar.get(Calendar.MONTH);
int dd = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePicker = new DatePickerDialog(context, R.style.DialogTheme, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
//String[] mons = new DateFormatSymbols(Locale.ENGLISH).getShortMonths();
//String mName = mons[monthOfYear];
expense_date = String.valueOf(year) + "-" + String.valueOf((monthOfYear + 1))
+ "-" + String.valueOf(dayOfMonth);
textView.setText(expense_date);
Log.d("djkjiksd", expense_date);
}
}, yy, mm, dd);
datePicker.show();
}
where as in theme.xml
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/light_yellow</item>
</style>
but the button colors are not coming on UI. What is the solution and correct way to implement date picker theme according to application.