android calendarview 属性,calendarview

本文介绍了如何使用Android平台的Calendar API插入约会事件,包括设置标题、描述、位置、日期范围以及是否全天和提醒。通过实例代码展示了如何操作content://com.android.calendar/events URI以完成数据添加。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

and

private void InsertAppointment(String strTitle, String strDescription, String strEventLocation, long StartDateTime, long EndDateTime, boolean bAllDay, boolean bHasAlarm){

int tAllday;

int tHasAlarm;

if (bAllDay = true){

tAllday = 1;

}

else

tAllday = 0;

if (bHasAlarm = true){

tHasAlarm = 1;

}

else

tHasAlarm = 0;

ContentValues event = new ContentValues();

// Calendar in which you want to add Evenet

event.put("calendar_id", CalId); //CalId

event.put("title", strTitle);

event.put("description", strDescription);

event.put("eventLocation", strEventLocation);

event.put("dtstart", StartDateTime);

event.put("dtend", EndDateTime );

event.put("allDay", 0);

event.put("hasAlarm", 0);

Uri eventsUri = Uri.parse("content://com.android.calendar/events");

// event is added

getContentResolver().insert(eventsUri, event);

}

a quick search on

content://com.android.calendar/calendars

will help get you started. but I'm not finished mine yet I just can't get the data out yet. but it is possible

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值