小编Hit*_*024的帖子

如何在Android设备中获取设备日历事件列表?

我想在Android设备上获得最后一天的日历活动吗?我是初学者所以告诉我一步一步的解决方案..!只有获取和阅读日历不更新和删除.有人帮帮我吗?我用下面的代码!

public class Example {

    public static void readCalendar(Context context) {

        ContentResolver contentResolver = context.getContentResolver();

        // Fetch a list of all calendars synced with the device, their display names and whether the
        // user has them selected for display.

        final Cursor cursor = contentResolver.query(Uri.parse("content://calendar/calendars"),
                (new String[] { "_id", "displayName", "selected" }), null, null, null);
        // For a full list of available columns see http://tinyurl.com/yfbg76w

        HashSet<String> calendarIds = new HashSet<String>();

        while (cursor.moveToNext()) {

            final String _id = cursor.getString(0);
            final String displayName …
Run Code Online (Sandbox Code Playgroud)

events android calendar

9
推荐指数
1
解决办法
3万
查看次数

标签 统计

android ×1

calendar ×1

events ×1