What is happening:: My date picker is allowing me to enter the date
What i am trying to do:: How to make sure the date picker shows (month,date,year) only greater than or equal to present one
DATE PICKER IMPLEMENTATION:
//*******Date picker implementation******(Start)***//
public void selectDate(View view) {
DialogFragment fragment = new SelectDateFragment();
fragment.show(getFragmentManager(), "DatePicker");
}
public void populateSetDate(int year, int month, int day) {
txtDateId = (TextView) getActivity().findViewById(R.id.txtDateId);
txtDateId.setText(month+"/"+day+"/"+year);
}
public class SelectDateFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
@Override
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);
}
}
//*******Date picker implementation******(End)***//