在 Android 中打开日历 [英] Open Calendar in Android

查看:18
本文介绍了在 Android 中打开日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在按钮单击时打开日历并获取可点击日期.

How to open Calendar on Button Click and get clickable Date.

推荐答案

看看这个:http://www.developer.com/ws/article.php/3850276/Working-with-the-Android-Calendar.htm

要从按钮单击事件打开日历,请将此代码添加到 onClick 方法:

To open calendar from button click event add this code to onClick method:

Intent i = new Intent();

//Froyo or greater (mind you I just tested this on CM7 and the less than froyo one worked so it depends on the phone...)
cn = new ComponentName("com.google.android.calendar", "com.android.calendar.LaunchActivity");

//less than Froyo
cn = new ComponentName("com.android.calendar", "com.android.calendar.LaunchActivity");

i.setComponent(cn);
startActivity(i);

这篇关于在 Android 中打开日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆