I\'m using the google example to insert a datepicker inside my app using a dialogfragment
http://developer.android.com/guide/topics/ui/controls/pickers.html
But
i have one correction to the above answer. instead of return the DatePickerDialog like this
return new DatePickerDialog(getActivity(), (EditSessionActivity)getActivity(), year, month, day);
you should return it in a more generic way
return new DatePickerDialog(getActivity(), (OnDateSetListener)getActivity(), year, month, day);
just make sure your activity implements OnDateSetListener interface and override the function onDateSet
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,int dayOfMonth)