如何打开系统日历

来源:互联网 发布:linux ntp服务安装 编辑:程序博客网 时间:2024/05/16 16:50

在开发中有时我们需要打开系统的相关功能,那么如何打开系统日历呢,看代码:

long startMillis; //需要跳转到的具体日期的毫秒值...Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();builder.appendPath("time");ContentUris.appendId(builder, startMillis);Intent intent = new Intent(Intent.ACTION_VIEW)    .setData(builder.build());startActivity(intent);

以上这段代码就是根据 传入的参数startMillis打开指定日期的日历。

0 0