Example usage for android.app DatePickerDialog getWindow

List of usage examples for android.app DatePickerDialog getWindow

Introduction

In this page you can find the example usage for android.app DatePickerDialog getWindow.

Prototype

public @Nullable Window getWindow() 

Source Link

Document

Retrieve the current Window for the activity.

Usage

From source file:me.tipi.kiosk.ui.fragments.IdentityFragment.java

/**
 * Show dob dialog./*w ww  .jav a2s . co m*/
 */
private void showDobDialog() {
    DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(),
            android.R.style.Theme_Holo_Light_Dialog, new DatePickerDialog.OnDateSetListener() {
                @Override
                public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                    birthdayLayout.setError(null);
                    Calendar calendar = Calendar.getInstance();
                    birthDayPickerView.setText(
                            String.format(Locale.US, "%d - %d - %d", dayOfMonth, monthOfYear + 1, year));
                    calendar.set(year, monthOfYear, dayOfMonth);
                    dob = calendar.getTime();
                }
            }, 1985, 6, 15);
    DatePicker datePicker = datePickerDialog.getDatePicker();
    datePickerDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    styleDatePicker(datePicker);
    datePickerDialog.show();
}