in Education by
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)

1 Answer

0 votes
by
This code worked for me try this ... styles.xml @android:color/holo_green_dark Popup Code Calendar mcurrentDate = Calendar.getInstance(); int mYear = mcurrentDate.get(Calendar.YEAR); int mMonth = mcurrentDate.get(Calendar.MONTH); int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH); DatePickerDialog mDatePicker; mDatePicker = new DatePickerDialog(context, R.style.DialogTheme, new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker datepicker, int selectedyear, int selectedmonth, int selectedday) { Toast.makeText(context,"Selected Date " + + selectedday + "-" + ++selectedmonth + "-" + selectedyear ,Toast.LENGTH_SHORT).show(); } }, mYear, mMonth, mDay); mDatePicker.show();

Related questions

0 votes
    (This is a random image of showing a Dialog found on the Internet.) I've been implementing a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    i want to run a task every 5 minutes. i've tried to solve it with an IntentService and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    The text on my buttons are set in resource files. E.g. The above code defines a button with text ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I'm working on this project and I required to allow the user to select a color from the color ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    Is it possible to change the background color of a radio button input in Firefox/Chrome like in IE? (Without using images) Run this in both IE(...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    What is not true in context of HTML tag ? O Table cell changes its width automatically based on content O We can ... table border is o Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    is it possible to change the background color of job designer in Talend?...
asked Mar 16, 2021 in Technology by JackTerrance
0 votes
    I'm looking at making an custom Android object Serializable. Should be simple I just cannot find a easy ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    I've made a fresh eclipse reinstall + Android SDK v4.0. I am trying to create a new 4.0 AVD ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to execute the following command: arp -a and I would like to redirect the output to a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    Here some snippet of my code. when first time RecyclerView create I have to used recyclerView.scrollToPosition( ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a fragment with a view and an options menu: public class OfferingsFragment extends Fragment { public ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I've noticed on Marshmallow (e.g. Nexus 6P) and also on some more recently updated Lollipop phones ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm trying to execute the following command: arp -a and I would like to redirect the output to a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    i have this problem that i want to upload image on a server through multi-part form but its keep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
...