Last active
December 10, 2019 15:22
-
-
Save magdamiu/5f7b1a6871cd80c905200102682195d8 to your computer and use it in GitHub Desktop.
DatePicker example
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
final Calendar c = Calendar.getInstance(); | |
year = c.get(Calendar.YEAR); | |
month = c.get(Calendar.MONTH); | |
day = c.get(Calendar.DAY_OF_MONTH); | |
DatePickerDialog datePickerDialog = new DatePickerDialog(this, | |
new DatePickerDialog.OnDateSetListener() { | |
@Override | |
public void onDateSet(DatePicker view, int year, | |
int monthOfYear, int dayOfMonth) { | |
textViewDate.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year); | |
} | |
}, year, month, day); | |
datePickerDialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment