android - 在 Android SDK 上导入 .ics 文件并添加到日历

标签 android android-calendar

我正在编写一个应用程序,它要求用户能够从服务器下载一个 .ics 文件并将所有包含的事件添加到他的本地日历中。不幸的是,我找不到任何关于此的教程或主题。如果有人有线索,请告诉我。

提前致谢。

最佳答案

所以我终于找到了解决问题的方法。只需在 Web View 中打开指向您的日历文件的链接,并确保 header 设置如下(您可能必须在日历文件的来源服务器上更改此设置):

<?php
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: attachment; filename=calendar.vcs");
?>

关于android - 在 Android SDK 上导入 .ics 文件并添加到日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24506325/

相关文章:

java - 来自字符串的 Android 日历对象

android - 日历 View 突出显示错误的星期

android 日历事件每年重复重复规则

android - 使用日历 API 摆脱 Android 日历事件中的 "Attending?"

android - 具有多种布局的 ExpandableListView

android - ClassCastException : XAdapter cannot be cast to android. widget.BaseAdapter - FastScroller

android - 使用 Google map 显示搜索结果

Android,监听器/观察器/日历事件更改回调

android - 是什么导致我的 C++ JNI 崩溃?

java - 使用外部 Intent/应用程序打开文件