Can't get my code for datepicker to work. Attempting to set max and minimum dates. I'm knowledge in this area is a little iffy. My code so far is below.
public class MainActivity extends FragmentActivity {
    EditText mEdit;
    public void onCreate(Bundle savedInstanceState) {

    public void selectDate(View view) {
        DialogFragment newFragment = new SelectDateFragment();, "DatePicker");
    public void populateSetDate(int year, int month, int day) {
        mEdit = (EditText)findViewById(;
    public class SelectDateFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            final Calendar calendar = Calendar.getInstance();
            int yy = calendar.get(Calendar.YEAR);
            int mm = calendar.get(Calendar.MONTH);
            int dd = calendar.get(Calendar.DAY_OF_MONTH);
            return new DatePickerDialog(getActivity(), this, yy, mm, dd);

        public void onDateSet(DatePicker view, int yy, int mm, int dd) {
            populateSetDate(yy, mm+1, dd);