Code example for DatePicker

Methods: initsetCalendarViewShown

     * @return a DatePicker with the date set 
    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);
        } 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