既存のカレンダーをすべて読み上げようとしています。ここから例を試しました:
http://developer.android.com/guide/topics/providers/calendar-provider.html
しかし、次のコンパイル エラーが発生します。メソッド getContentResolver() は、タイプ xxx に対して未定義です。
public HashMap<String, String> readCalendar() {
String[] EVENT_PROJECTION = new String[] {
Calendars._ID,
Calendars.OWNER_ACCOUNT,
Calendars.ACCOUNT_NAME,
Calendars.CALENDAR_DISPLAY_NAME
};
String selectionICS = "((" + Calendars.ACCOUNT_NAME + " = ?) AND ("
+ Calendars.ACCOUNT_TYPE + " = ?) AND ("
+ Calendars.OWNER_ACCOUNT + " = ?))";
String[] selectionArgs = new String[] {"VISIBLE=1"}; // or "selected=1" ??
Cursor managedCursor = null;
ContentResolver cr = getContentResolver();
managedCursor = cr.query(calendarUri, EVENT_PROJECTION, selectionICS, selectionArgs, null);selectionICS, selectionArgs, null);
}