Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- [1] Create this code into onCreate
- */
- dateFormatter = new SimpleDateFormat("dd-MM-yyyy", Locale.US);
- }
- private DatePickerDialog datePickerDialog;
- private SimpleDateFormat dateFormatter;
- /*
- [2] Create zombies function
- */
- private void zombies(){
- /*
- [3] Create moreblock with name showDateDialog()
- */
- datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
- @Override
- public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
- Calendar newDate = Calendar.getInstance();
- newDate.set(year, monthOfYear, dayOfMonth);
- edt_date.setText("Tanggal dipilih : "+dateFormatter.format(newDate.getTime()));
- }
- },calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
- datePickerDialog.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement