title: AndroidStudio Calendar.get(Calendar.DAY_OF_MONTH) nullPointer Exception
body: <p>I have a problem with my calendar.
  Here is the code:</p>
  
  <pre><code>Calendar mCalendar = Calendar.getInstance();
  mToday[0] = mCalendar.get(Calendar.DAY_OF_MONTH);
  mToday[1] = mCalendar.get(Calendar.MONTH); // zero based
  mToday[2] = mCalendar.get(Calendar.YEAR);
  </code></pre>
  
  <p>Can not run my project because AndroidStudio shows error on the <code>Calendar.DAY_OF_MONTH</code>, <code>Calendar.MONTH</code> etc... I get nullPointException while running in emulator</p>
  
  <p>It sais that </p>
  
  <blockquote>
    <p>Must be one of:
    java.util.Calendar.DAY_OF_MONTHjava.util.Calendar.MONTH etc...</p>
  </blockquote>
  
  <p>I don't understand this error because <code>Calendar.MONTH</code> is one of <code>java.util.calendar.MONTH</code></p>
  
  <p>I have an import for it</p>
  
  <pre><code>import java.util.Calendar;
  </code></pre>
  
  <p>Sorry I missed that it's initialized but there is an other class where I want to use Calendar.MONTH and so on like this:</p>
  
  <pre><code>mCalendarToday = Calendar.getInstance();
  
  ...
  
  int dayOfWeek = mCalendar.get(Calendar.DAY_OF_WEEK);
  int firstDay = getDay(mCalendar.get(Calendar.DAY_OF_WEEK);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>private Calendar mCalendarToday;
  
  ...
  
  private boolean isToday(int day, int month, int year) {
      if (mCalendarToday.get(Calendar.MONTH) == month
          &amp;&amp; mCalendarToday.get(Calendar.YEAR) == year
          &amp;&amp; mCalendarToday.get(Calendar.DAY_OF_MONTH) == day) {
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>Here shows error too. And all the other lines where I would use.</p>