コード例 #1
0
  private boolean validate() {
    if (repeatRepRadio.isChecked()) {
      try {
        Integer.valueOf(repeatRepEdit.getText().toString());
      } catch (NumberFormatException ex) {
        activity.showError(R.string.selectionContinueMessage);

        return false;
      }
      return true;
    } else if (repeatUntilRadio.isChecked()) {
      return DateUtil.isValidDate(repeatUntilDate.getText().toString());
    }
    activity.showError(R.string.selectionContinueMessage);
    return false;
  }
コード例 #2
0
 public void testIsValidDate() {
   assertTrue(DateUtil.isValidDate("2008-02-29"));
   assertFalse(DateUtil.isValidDate("2009-02-29"));
 }