Guest User

Untitled

a guest
Apr 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. datebutton.setOnClickListener(new View.OnClickListener() {
  2. public void onClick(View v) {
  3. showDialog(DATE_DIALOG_ID);
  4. }
  5. });
  6.  
  7.  
  8. timebutton.setOnClickListener(new View.OnClickListener() {
  9. public void onClick(View v) {
  10. showDialog(TIME_DIALOG_ID);
  11. }
  12. });
  13.  
  14.  
  15. @Override
  16. protected Dialog onCreateDialog(int id) {
  17. switch (id) {
  18. case DATE_DIALOG_ID:
  19. return new DatePickerDialog(getDialogContext(),
  20. mDateSetListener,
  21. mYear, mMonth, mDay);
  22.  
  23. case TIME_DIALOG_ID:
  24. return new TimePickerDialog(getDialogContext(),
  25. mTimeSetListener, mHour, mMinute, false);
  26.  
  27.  
  28. }
  29. return null;
  30. }
Add Comment
Please, Sign In to add comment