Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android日历:使用intent创建了一个事件,但它不会返回到我的活动_Android_Events_Android Intent_Insert_Calendar - Fatal编程技术网

Android日历:使用intent创建了一个事件,但它不会返回到我的活动

Android日历:使用intent创建了一个事件,但它不会返回到我的活动,android,events,android-intent,insert,calendar,Android,Events,Android Intent,Insert,Calendar,我的应用程序启动了一个意图呼叫日历应用程序,插入带有这些代码的事件 Intent intent = new Intent(Intent.ACTION_INSERT) .setData(Events.CONTENT_URI) .putExtra(Events.DTSTART, date.getTime()) .putExtra(Events.DTEND, date.getTime() + DateUtils.HOUR_IN_MILLIS) .putExtra

我的应用程序启动了一个意图呼叫日历应用程序,插入带有这些代码的事件

    Intent intent = new Intent(Intent.ACTION_INSERT)
    .setData(Events.CONTENT_URI)
    .putExtra(Events.DTSTART, date.getTime())
    .putExtra(Events.DTEND, date.getTime() + DateUtils.HOUR_IN_MILLIS)
    .putExtra(Events.EVENT_TIMEZONE, TimeZone.getDefault().getDisplayName());
    startActivityForResult(intent,EDIT_EVENT_AGENDAUI);
        //startActivity(intent); dosent make any difference
正如您在这里看到的,它调用日历插入页面。 但奇怪的是,它不会回到我的应用程序,而不是回到日历视图 单击“完成”后。我必须点击屏幕上的“后退”按钮才能返回到我的应用程序

这有点不友好

谷歌搜索了半天 似乎没有人会遇到这个问题

有什么想法吗?谢谢

PS

  • 我在虚拟机上使用安卓ICS
  • 如果我单击“取消”退出页面,它将按照我的预期运行--返回到我的应用程序。这很好,但更让我困惑

  • 你所经历的是正确的行为。我不知道有哪种快捷方式可以只添加事件而不进入日历活动,除非有一些日历的公共内容提供商


    特别是在ICS中,“添加事件”窗口可能只是日历活动中包含的一个片段,因此在单击“保存”后看到事件是非常有意义的。

    这不是我所期望的,但我的问题是,当您在“日历”视图中按“上一步”按钮时,返回到onActivityResult的
    requestCode
    为0。这意味着这是一个错误或意图被取消。当我试图从弹出窗口中放弃日历事件,但它不会返回到我的活动时,我面临一个问题。你能帮我一下吗。