在开发中有时我们需要打开系统的相关功能,那么如何打开系统日历呢,看代码:
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打开指定日期的日历。