This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showDatePickerDialog(final View v) { | |
Calendar cal = Calendar.getInstance(); | |
DatePickerDialog datePickerDialog = new DatePickerDialog(v.getContext(), | |
android.R.style.Theme_Holo_Light_Dialog_MinWidth, | |
new DatePickerDialog.OnDateSetListener() { | |
@Override | |
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { | |
Calendar calendarInstance = Calendar.getInstance(); | |
calendarInstance.set(year, monthOfYear, dayOfMonth); | |
((EditText) v).setText(df.format(calendarInstance.getTime())); | |
} | |
}, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); | |
datePickerDialog.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment