please delete me
please delete me

Reputation: 27

TimePickerDialog theme change

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

Answers (1)

adneal
adneal

Reputation: 30814

Use one of the five built-in AlertDialog themes:

For instance:

    MyTimePickerDialog timePickerDialog = new MyTimePickerDialog(AdvancedCDT.this,
            TimePickerDialog.THEME_HOLO_DARK, timeSetListener, 0, 0, true);

Results

Example

Upvotes: 5

Related Questions