I am trying to open default calendar application from my application in android. I did get some links in regard to this
Intent calendarIntent = new Intent() ;
calendarIntent.putExtra("beginTime", tempCal.getTimeInMillis());
calendarIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT |
Intent.FLAG_ACTIVITY_SINGLE_TOP);
calendarIntent.setClassName("com.android.calendar","com.android.calendar.AgendaActivity");
startActivity(calendarIntent);
This does open the calendar. But, I want the calendar app to open in the month mode (showing list of days in month). I need help on this.
Thanks in advance 🙂
After reviewing the Calendar App in the Android source code you can only invoke the AgendaActivity directly. The others will not work. You can interact directly with the cursor to read/create events, but you can’t invoke the calendar app to a view other than the AgendaView. The reason is that the developers have limited that ability in the manifest for the Cal app by using the following activity definitions:
Note that only the AgendaActivity has
android:exported="true". If you attempt to call the other activities you will get a permission exception.