Reputation: 27
I wrote this code to make a TimePickerDialog box
btnDialBoxTime.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
MyTimePickerDialog timePickerDialog = new MyTimePickerDialog(AdvancedCDT.this, android.R.style.Theme_DeviceDefault, timeSetListener, 0, 0, true);
timePickerDialog.setTitle("Set hours and minutes");
timePickerDialog.show();
}
});
The dialog box appear correctly but the Theme is white.
I would like to have it black/gray which is the default of my Nexus 7.
The android.R.style.Theme_DeviceDefault does not seem to function.
Upvotes: 1
Views: 8846
Reputation: 30814
Use one of the five built-in AlertDialog
themes:
THEME_TRADITIONAL
- The traditional (pre-Holo) alert dialog theme
THEME_HOLO_DARK
- The holographic alert theme with a dark background
THEME_HOLO_LIGHT
- The holographic alert theme with a light background
THEME_DEVICE_DEFAULT_DARK
- The device's default alert theme with a dark background.
THEME_DEVICE_DEFAULT_LIGHT
- The device's default alert theme with a light background.
For instance:
MyTimePickerDialog timePickerDialog = new MyTimePickerDialog(AdvancedCDT.this,
TimePickerDialog.THEME_HOLO_DARK, timeSetListener, 0, 0, true);
Results
Upvotes: 5