title: Android Calendar: get the next seven days details - date and month gives IllegalArgumentException
body: <p>Aim: to fetch the next seven days (including the current day).
  I am using add(int field, int value) method of the Calendar class.</p>
  
  <p>Code:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  
  for (int i = 0; i &lt; 7; i++){
  
      int index = cal.get(Calendar.DAY_OF_WEEK) - 1;
      String text = cal.get(Calendar.DATE) + " " +cal.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.getDefault());
      cal.add(cal.get(Calendar.DAY_OF_MONTH), 1);
      Log.d(TAG, text);
  
  }
  </code></pre>
  
  <p>Throws IllegalArgumentException.
  According to the <a href="http://developer.android.com/reference/java/util/Calendar.html#add%28int,%20int%29" rel="nofollow">docs</a>, this exception is thrown if the field is ZONE_OFFSET or DST_OFFSET.</p>
  
  <p>Logcat:</p>
  
  <pre><code>E/AndroidRuntime(17841): Caused by: java.lang.IllegalArgumentException
  E/AndroidRuntime(17841):    at java.util.GregorianCalendar.add(GregorianCalendar.java:357)
  </code></pre>