Android的Google日历 [英] android calendar

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

问题描述

ComponentName componentName = new ComponentName("com.android.calendar",
        "com.android.calendar.LaunchActivity");
if (componentName != null) {
    Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
    // com.android.providers.calendar.CalendarProvider
    intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);

    intent.setComponent(componentName);
    startActivity(intent);
} else {
    Log.i("", "98979");
}

LogCat中返回以下错误:

LogCat returns the following error:

ERROR / AndroidRuntime(601):android.content.ActivityNotFoundException:产生的原因结果
  无法找到明确的活动类 {com.android.calendar / com.android.calendar.LaunchActivity} ;结果
  有你在你的Andr​​oidManifest.xml宣布这项活动?

ERROR/AndroidRuntime(601): Caused by: android.content.ActivityNotFoundException:
Unable to find explicit activity class {com.android.calendar/com.android.calendar.LaunchActivity};
have you declared this activity in your AndroidManifest.xml?

什么是新的日历地址或包?

What is the new calendar address or package?

推荐答案

试试这个,

其工作对我来说,打开谷歌日历,没有手机的

its working for me, to open google Calendar, not phone's

 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);

我也搜索打开手机日历

i am also searching to open phones calendar

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

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