-
-
Save jezinka/8f35a838d0581d4f1b0ce8f2325f4918 to your computer and use it in GitHub Desktop.
This file contains hidden or 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