Use DatePickerDialog :
return new DatePickerDialog(getActivity(), this, year, month, day);
Your class declaration should look like this:
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
You will need to implement the OnDateSet method:
@Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { mDate = new GregorianCalendar(year, monthOfYear, dayOfMonth).getTime(); getArguments().putSerializable(EXTRA_DATE, mDate); sendResult(Activity.RESULT_OK); }
Or you can install your theme on Holo.Light, which seems to support DatePicker OnDateChanged events. In the manifest file:
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:theme="@android:style/Theme.Holo.Light">
Or you can lower your minimum API level, this will set the Holo theme by default:
<uses-sdk android:minSdkVersion="15" />
source share