title: java.lang.SecurityException: Permission Denial: starting Intent com.android.calendar/.DayActivity
body: <p>In my app I use the following code to open standard android calendar on the DayView:</p>
  
  <pre><code>Intent intent2 = new Intent();
  intent2.setComponent(new ComponentName("com.android.calendar", "com.android.calendar.DayActivity"));
  intent2.setAction("android.intent.action.MAIN");
  intent2.addCategory("android.intent.category.LAUNCHER");
  intent2.setFlags(0x10200000);
  intent2.putExtra("beginTime", (new Time()).setJulianDay(reqDay));
  intent2.putExtra("DETAIL_VIEW", true);
  intent2.putExtra("DETAIL_VIEW_MODE", 2);
  context.startActivity(intent2);
  </code></pre>
  
  <p>This used to work perfectly fine - and still is working perfectly fine on most handsets.  However on one phone (Android 2.3 - CM7) yesterday I started receiving this error (line breaks added for readability):</p>
  
  <pre><code>Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
  flg=0x10200000 cmp=com.android.calendar/.DayActivity (has extras) }
  from ProcessRecord{407719a0 3244:com.lge.android.calendarwidget/10077}
  (pid=3244, uid=10077) requires null
  </code></pre>
  
  <p>The full error from the log cat is below:</p>
  
  <pre><code>I/ActivityManager(  245): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.calendar/.DayActivity (has extras) } from pid 3244
  W/ActivityManager(  245): Permission denied: checkComponentPermission() reqUid=10004
  W/ActivityManager(  245): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.calendar/.DayActivity (has extras) } from ProcessRecord{407719a0 3244:com.lge.android.calendarwidget/10077} (pid=3244, uid=10077) requires null
  W/calw3   ( 3244): com.android.calendar not found, trying com.google.android.calendar
  W/calw3   ( 3244): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.calendar/.DayActivity (has extras) } from ProcessRecord{407719a0 3244:com.lge.android.calendarwidget/10077} (pid=3244, uid=10077) requires null
  </code></pre>
  
  <p>Two questions I have: (1) Why did it break all of a sudden?  It definitely worked on this phone before (this is my main phone); and (2) how can I fix it?</p>
  
  <p><strong>EDIT</strong> Just to add that this same code is still working perfectly fine on another phone I own (HTC Desire X).</p>