0

Is it possible to launch the Google calendar app from within another app, Or even better launch your own Local Google calender into monthView with only the events you create shown?

I'll be using API 14+, if it is possible can you provide some code or link to an example.

Please bear in-mind I'm still new to programming so please go slowly and explain.

Nazik
  • 8,696
  • 27
  • 77
  • 123
J4C3N-14
  • 686
  • 1
  • 13
  • 32

1 Answers1

0

For API 14+ You're best to look at Calendar Provider. This provides intents to read events and view a calendar.

As an example to view a calendar

// A date-time specified in milliseconds since the epoch.
long startMillis;
...
Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();
builder.appendPath("time");
ContentUris.appendId(builder, startMillis);
Intent intent = new Intent(Intent.ACTION_VIEW).setData(builder.build());
startActivity(intent);
Lionel Port
  • 3,492
  • 23
  • 26
  • Happy to be corrected but how about a reason for the down vote. – Lionel Port Jun 12 '13 at 01:34
  • hi thanks for your answer. To the best of my knowledge I didn't down vote you, is it possible for someone else to? Like you said a reason would be good. In regards to your answer does this display a day view, week or month at a time? Thank you for pointing me in a direction though as I'll check out the Provider – J4C3N-14 Jun 12 '13 at 10:44
  • hi @Lionel Port, Just been trying your suggested route and although I can launch the users calendar I can only open it to a specific event. Are you aware of any way to launch into monthView and view all events?? Thank you – J4C3N-14 Jun 12 '13 at 21:18
  • 1
    Are you passing the parameter "time" as the example above. There are two modes for this. If you pass event id it will show the event view if you pass start time it should open the date view. Specific section http://developer.android.com/guide/topics/providers/calendar-provider.html#intent-view – Lionel Port Jun 13 '13 at 04:21