Code example for DatePicker

Methods: initsetCalendarViewShown

0
     * 
     * @return a DatePicker with the date set 
     */ 
    @Override 
    protected View onCreateDialogView() {
        this.datePicker = new DatePicker(getContext());
        Calendar calendar = getDate();
        datePicker.init(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
                calendar.get(Calendar.DAY_OF_MONTH), this);
        try{ 
            datePicker.setCalendarViewShown(false);
        } catch(NoSuchMethodError e){
            //handel ics 
        } 
        return datePicker;
    } 
 
    /** 
     * Produces the date used for the date picker. If the user has not selected a 
     * date, produces the default from the XML's android:defaultValue. If the 
     * default is not set in the XML or if the XML's default is invalid it uses