Reputation: 3038
can anybody help me about what to insert in the eventTimezone value when adding an event to a calendar? this is my code:
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", eventName);
intent.putExtra("beginTime", startCal.getTimeInMillis());
intent.putExtra("endTime", endCal.getTimeInMillis());
intent.putExtra("eventTimezone","Hong Kong");
startActivity(intent);
everything else works fine but the eventTimezone doesnt seem to change the option of the timezone to my desired timezone. what value do i need? ive tried "GMT+1" and "(GMT+8:00) Hong Kong" but they are not working.
Upvotes: 4
Views: 3669
Reputation: 2166
This is how you get the timezone into it
TimeZone tz = TimeZone.getDefault();
intent.putExtra(Events.EVENT_TIMEZONE, tz.getID());
Upvotes: 8