Android添加事件到日历
2016-11-07 15:43
344 查看
就是一个方法设置较多参数:
然后就会拉起Android的日历界面:
注意:我用的是张全蛋的SamSong。还测试了小米,也OK,就不贴图了。
public void saveCalender(View view) { Intent calendarIntent = new Intent(Intent.ACTION_INSERT, CalendarContract.Events.CONTENT_URI); Calendar calendar = Calendar.getInstance(); calendar.set(2016, 10, 19, 7, 30); calendarIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, calendar.getTimeInMillis()); calendar.set(2016, 10, 19, 10, 30); calendarIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, calendar.getTimeInMillis()); calendarIntent.putExtra(CalendarContract.Events.TITLE, "上课"); calendarIntent.putExtra(CalendarContract.Events.EVENT_LOCATION, "电教楼3层303教师"); calendarIntent.putExtra(CalendarContract.Events.DESCRIPTION, "苍老师的课,不能缺勤"); calendarIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, CalendarContract.EXTRA_EVENT_ALL_DAY); startActivity(calendarIntent); }
然后就会拉起Android的日历界面:
注意:我用的是张全蛋的SamSong。还测试了小米,也OK,就不贴图了。
相关文章推荐
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- Android 向系统日历中添加事件
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- android 读写系统日历、插入事件、添加多个提醒的问题
- Android 向系统日历中添加事件
- Android日历周视图 可添加事件标记
- Android向系统日历中添加日程事件
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- android自定义日历并添加事件
- Android向系统日历中添加日程事件
- Android向系统日历中添加日程事件(一种闹钟实现)
- android 周日历控件加事件动态添加
- Android向系统日历中添加日程事件
- Android 弹出系统日历,添加提醒事件
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- 调用Android自带日历功能(日历列表单、添加一个日历事件)
- android 应用组件[通用 Intent---添加日历事件] 五
- Android基础---给控件添加事件
- 3.Android开发---为按钮添加事件的三种方法