如何实现往android手机系统日历插入数据

插入数据实现了,主要是因为各种安卓手机系统日历不同,导致有些手机数据无法插入到系统日历
static {
if (Build.VERSION.SDK_INT >= 8) {
calanderURL = "content://com.android.calendar/calendars";
calanderEventURL = "content://com.android.calendar/events";
calanderRemiderURL = "content://com.android.calendar/reminders";

    } else {
        calanderURL = "content://calendar/calendars";
        calanderEventURL = "content://calendar/events";
        calanderRemiderURL = "content://calendar/reminders";
    }
}添加这几行代码也不管用

String calId = "";
    String account = "";
    Cursor userCursor = getActivity().getContentResolver().query(Uri.parse(calanderURL), null, null, null, null);
    if (userCursor.getCount() > 0) {
        userCursor.moveToFirst();
        calId = userCursor.getString(userCursor.getColumnIndex("_id"));
        account = userCursor.getString(userCursor.getColumnIndex("ACCOUNT_NAME"));
        LogTools.e(PregnantRemindFragment.this, "calId----------" + calId);
        LogTools.e(PregnantRemindFragment.this, "账户名----------" + account);
    }

    calId打印出来的log都是1,account各不相同,上网找资料也挺难找的,有谁处理过这类问题的,麻烦给指点下呗
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问