I am trying to display a DatePicker dialog on top of another activity and what is happening is it is somehow inheriting its color.
I'd like it to have a green header and white background,
Here is excerpt from styles
@null
true
true
@color/primary
And this code is used to pop up the DatePicker
DatePickerDialog datepicker = new DatePickerDialog(this, R.style.DatePickerDialog, new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
TextView newdate = (TextView) findViewById(R.id.newdate);
Date date = getDate(year, monthOfYear, dayOfMonth);
DateFormat dateformat = new SimpleDateFormat(getResources().getString(R.string.date_format_full));
newdate.setText(dateformat.format(date));
}
}, newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));
datepicker.show();
If I specify the white background in the styles,
@color/app_background
One last thing I've tried is to use AlertDialog.THEME_DEVICE_DEFAULT_DARK as the DatePicker theme
DatePickerDialog datepicker = new DatePickerDialog(this,
AlertDialog.THEME_DEVICE_DEFAULT_DARK, new
DatePickerDialog.OnDateSetListener()
Here is the style of the activity I am opening the dialog from
@null
true
true
@color/primary
@color/dialog_text
@color/app_background
@style/NewDialogTitle
center_horizontal
And the colors I am using
#4CAF50
#FFFFFF
Does anyone know how to get it done? I'd appreciate any guidance. I've tried to follow this answer, but had no luck
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)