尝试为事件设置时区

jav*_*srk 6 android google-calendar-api

就像标题所说,我正在创建一个事件,它似乎没有设置正确的时区......我做错了什么?作为参考,我使用12:00 PM作为开始时间.开始时间显示正确,但不是时区.我不想将时间转换为用户/设备的时区.

        Calendar cal = new GregorianCalendar();         
        cal.setTime(tDate);

        Intent intent = new Intent(Intent.ACTION_EDIT);
        intent.setType("vnd.android.cursor.item/event");
        intent.putExtra("beginTime", cal.getTimeInMillis());
        intent.putExtra(Events.ALL_DAY, false);
        intent.putExtra(Events.TITLE, "Title goes here");
        intent.putExtra(Events.EVENT_LOCATION, "Los Angeles");
        intent.putExtra(Events.EVENT_TIMEZONE, "America/Los_Angeles");
        intent.putExtra(Events.DESCRIPTION, "Test");
        startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

Jst*_*wll 0

添加事件的意图方法(如此处所述似乎不支持时区 extra\xe2\x80\x94,至少在给出的示例中不支持。以下是基于该示例的一些提示:

\n\n\n\n

如果您需要设置时区,您可以使用 ContentResolver 来添加事件,而不使用意图方法。

\n