gpt4 book ai didi

安卓谷歌日历 "Unable to launch event"

转载 作者:行者123 更新时间:2023-12-03 17:05:52 25 4
gpt4 key购买 nike

案例一
我主持了一个日历 Activity iCal .ics Amazon AWS 上的文件和指向该文件的 HTTP URL 集成在我的 Android 应用程序中。

Here is the file

当用户点击 URL 时,会显示一个带有以下选项的 Intent 选择器:

  • 日历应用程序
  • 浏览器下载文件

  • 当我选择 Google 日历时,它给了我一个错误提示“无法启动 Activity ”

    当我选择 Chrome 时,文件已下载,当用户单击下载的文件时,它会给出相同的错误“无法启动事件”

    以下是使用桌面 chrome http 客户端 Postman 下载文件时的响应 header
    Accept-Ranges → bytes
    Content-Length → 959
    Content-Type → application/octet-stream
    Date → Thu, 10 Mar 2016 13:45:10 GMT
    ETag → "5d48719213395a28e09e8adf01f6ce83"
    Last-Modified → Wed, 09 Mar 2016 15:24:22 GMT
    Server → AmazonS3
    x-amz-id-2 → XXXXXXXXXXXXXXXXXXXXXXXXX
    x-amz-request-id → XXXXXXXXXXXXXXXXXXX

    案例二
    为了进行实验,我在本地 Apache 服务器上编写了一个简单的 PHP 脚本来下载相同的文件,而不是直接从 HTTP URL 访问文件

    PHP 代码
    <?php
    $file = $_GET['file'];
    if (file_exists($file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
    ob_clean();
    flush();
    readfile($file);
    exit;
    }
    ?>

    该文件已成功下载,然后
  • 点击下载的文件
  • Google 日历是从 Intent 选择器中选择的
  • 事件在谷歌日历中添加成功

  • 以下是使用 PHP 脚本时的响应 header
    Cache-Control → must-revalidate, post-check=0, pre-check=0
    Connection → Keep-Alive
    Content-Description → File Transfer
    Content-Disposition → attachment; filename=World_Television_Premiere_of_House_Of_Cards_March_1213_5pm_on_Zee_Cafe.ics
    Content-Length → 959
    Content-Transfer-Encoding → binary
    Content-Type → application/octet-stream
    Date → Thu, 10 Mar 2016 07:27:15 GMT
    Expires → 0
    Keep-Alive → timeout=5, max=100
    Pragma → public
    Server → Apache/2.4.7 (Ubuntu)
    X-Powered-By → PHP/5.5.9-1ubuntu4.14

    任何人都可以帮助理解为什么事件没有保存或适用于案例 1 吗?

    提前致谢。
    请帮忙。

    编辑

    安卓设备:Nexus 6 (6.0.1)

    谷歌日历应用:5.3.6-115544951-release

    最佳答案

    目前 - 它是 2016 年 4 月 27 日 - 提供的文件在我的适用于 Android v.5.4-1198 的 Google 日历上可以正常打开...但我遇到了类似的问题,结果发现 Google 日历无法导入 UTF 的 .ics 文件-8 与 BOM 。现在我从服务器将它们作为没有 BOM 的 UTF-8 发送,一切都很好。

    关于安卓谷歌日历 "Unable to launch event",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35918537/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com