【发布时间】:2014-05-20 08:30:33
【问题描述】:
我需要从我的服务器获取一些 json 数据,其中包含有关公司员工协助的数据。我正在使用CalendarView的示例
我需要更改数据来源:
Cursor cursor = context.getContentResolver()
.query(Uri.parse("content://com.android.calendar/events"),
new String[] { "calendar_id", "title", "description",
"dtstart", "dtend", "eventLocation" }, null,
null, null);
到
Cursor cursor = context.getContentResolver()
.query(Uri.parse("http://www.gettford.net/comunidad/api/calendario.php"),
new String[] { "calendar_id", "title", "description",
"dtstart", "dtend", "eventLocation" }, null,
null, null);
显然代码是错误的,但我不知道如何将 json 放入游标中,我知道如何获取 json 并将其插入到数组中,但在这种情况下我不知道该怎么做。
感谢任何帮助
提前致谢。
【问题讨论】:
-
Obviously the code is wrong... 为什么?似乎是什么问题?你有错误吗?
标签: android json android-calendar android-cursor android-json