title: checking two Calendars against each other to see if they are are more then a week apart
body: <p>I have two datepickers for search parameters but i cant have the search more then a week(to much of a load on the server) so i want to check if the first date is before the second one, and if the first date and second date are less then 7 days apart. if all is correct then return a true boolean if not false.</p>
  
  <pre><code>public Calendar max = Calendar.getInstance();
  
  public boolean checkweek(Calendar cStart, Calendar cEnd) {
      Toast.makeText(this,
              cStart.DAY_OF_MONTH + " - " + cStart.MONTH + " - " + cStart.YEAR, Toast.LENGTH_LONG).show();
      if (cEnd.after(cStart) || ((cEnd.DAY_OF_MONTH == cStart.DAY_OF_MONTH) &amp;&amp; (cEnd.MONTH == cStart.MONTH))) {
          max.set(Calendar.YEAR, cStart.YEAR);
          max.set(Calendar.MONTH, cStart.MONTH);
          max.set(Calendar.DAY_OF_MONTH, cStart.DAY_OF_MONTH);
          max.add(Calendar.DAY_OF_MONTH, 7);
          Toast.makeText(this,
                  max.DAY_OF_MONTH + " - " + max.MONTH + " - " + max.YEAR,
                  Toast.LENGTH_LONG).show();
          if (cEnd.before(max)) {
              return true;
          }
          else{
              return false;
          }
      }
      else{
      return false;}
  }
  </code></pre>
  
  <p>But it throws a null exception. im declaring the cStart and cEnd so i have no idea what it is...</p>