以编程方式创建可同步的Android日历 [英] Create syncable android calendar programmatically
问题描述
我开发了一个应用程式功能,可透过应用程式建立及同步处理本地电话日历。现在我必须在线同步此日历,最好通过本机手机帐户。
我试图通过帐户名称和类型扩展URI的内容值参数(见下面的API LVL< 8参数列表),但是之后运行到日历中冻结。
i developed an app-feature to create and sync a local phone calendar through an app. Now i have to sync this calendar online, best through the native phone account. I tried to extend the URI's content values parameter (see API LVL < 8 parameter list below) by the account name and type but running after that into calendar freezes.
_id
sync_account
_sync_account_type
_sync_id
_sync_version
_sync_time
_sync_local_id
_sync_dirty
_sync_mark
url
name
displayName
hidden
color
access_level
selected
sync_events
location
timezone
ownerAccount
还有另一种方法来创建在线可同步的Google日历?
Is there another way to create an online syncable google calendar?
推荐答案
不能以程序方式创建新的。
而不是解析所有可用的
You cannot create a new one programatically. Instead parse all available ones with
Uri.parse("content://com.android.calendar/calendars",null, null, null, null);
并将活动填入现有活动。
但确保您的活动获得相同
and fill in your events into a existing one.
But ensure, that your event got the same
sync_account
和
_sync_account_type
这篇关于以编程方式创建可同步的Android日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!