Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. mCalendar = Calendar.getInstance();
  2. DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() {
  3.  
  4. @Override
  5. public void onDateSet(DatePicker view, int year, int monthOfYear,
  6. int dayOfMonth) {
  7. // Here I want to check if the date is good.
  8. // if its good - call GetPlayersList()
  9. // if not - raise a message and let user choose again
  10. mCalendar.set(Calendar.YEAR, year);
  11. mCalendar.set(Calendar.MONTH, monthOfYear);
  12. mCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
  13. new GetPlayersList().execute(Utilities
  14. .getAccessToken(AttendanceActivity.this));
  15. }
  16.  
  17. };
  18.  
  19. new DatePickerDialog(AttendanceActivity.this, date,
  20. mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH),
  21. mCalendar.get(Calendar.DAY_OF_MONTH)).show();
  22.  
  23. int dayOfWeek = mCalendar.get(Calendar.DAY_OF_WEEK);
  24.  
  25. if(dayOfWeek == 3) {
  26. // it is a Wednesday
  27. } else {
  28. // it is not a Wednesday
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement