在Android开放日历 [英] Open Calendar in Android

查看:158
本文介绍了在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

编辑:

从按钮的Click事件打开日历添加这个code到的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天全站免登陆