Reputation: 6357
I have a tabbed view. I want to embed Google Calendar into my tab view. So, when the user clicks 'Week' tab, I'll programatically change the calendar view to Weekly. If user clicks 'Month' tab, I'll programatically change the calendar view to Monthly and so on..
I thought as the calendar is from google, it would be very easy to embed. But it seems I was wrong. So far, I could only find this code:
ComponentName cn;
Intent i = new Intent();
cn = new ComponentName("com.android.calendar", "com.android.calendar.LaunchActivity");
i.setComponent(cn);
startActivity(i);
But it launches the calendar. Instead, I want it to be embedded in my app. Is it possible? I don't care if it doesn't work on emulator. I am testing on real devices all the time.
Other Info of my App:
MindSdkVersion = 8
TargetSdkVersion = 14
However, I can compromise on minSdkVersion if there is REALLY no solution for version 8.
Upvotes: 1
Views: 1419
Reputation: 1006799
I thought as the calendar is from google, it would be very easy to embed
You cannot embed other apps into your own. That has nothing to do with the AOSP Calendar app specifically.
Is it possible?
No. You are welcome to use CalendarContract
on API Level 14+ devices to implement your own calendar UI that is backed by the same data that the AOSP Calendar app uses.
Upvotes: 1