我必须将 Google 日历中的 Activity 添加到我自己的 Android 应用程序中。我该怎么做?
这里我使用了 gdata lib,但是在 for 迭代中我得到了一些 id 而不是 tile。
提前致谢。
DocsService client = new DocsService("myappname");
try {
client.setUserCredentials("example@gamil.com",
"pwd");
URL feedUri = new URL(
"https://docs.google.com/feeds/default/private/full/");
DocumentListFeed feed = client.getFeed(feedUri,
DocumentListFeed.class);
// TextView textView = (TextView) findViewById(R.id.textView1);
String text = "";
for (DocumentListEntry entry : feed.getEntries()) {
// text += entry.getTitle().getPlainText() + "\r\n";
list.add(entry.getTitle().toString());
}
return list;
// textView.setText(text);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
最佳答案
您需要使用 Calender Provider为此
有关 Activity ,请查看以下链接:
http://developer.android.com/guide/topics/providers/calendar-provider.html#events
这里有一些博客和相同的解释
http://www.grokkingandroid.com/androids-calendarcontract-provider/
在这个link展示了如何读取和编辑日历提供程序中的事件。
希望这有助于...
关于android - 如何使用 google calendar api 在 android 中获取 Google Calendar 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19286989/