2010-10-09 85 views
1

我已成功地利用閱讀谷歌日曆值

myEntry.setTitle(new PlainTextConstruct("TEST")) 
myEntry.setContent(new PlainTextConstruct("See how much text will fit in there")) 

然後,我已經成功地讀取事件記錄的事件。

這工作

myTitle = ret.getTitle().getPlainText() 

但是,這會引發錯誤

myTitle = ret.getContent().getPlainText() 

groovy.lang.MissingMethodException: No signature of method: 
com.google.gdata.data.TextContent.getPlainText() 

沒有,如果我做越好

myTitle = req.getContent().toString() 

什麼我已經錯過了任何想法?

回答

0

嘗試:

myContent = ret.getTextContent() 

或:

myContent = ret.getPlainTextContent() 
+0

它做。如果你這樣做ret.getContent()的getType()返回1,表明它是文本 – 2010-10-09 08:57:42

+0

這是getPlainText(。 ),拋出異常 – 2010-10-09 09:05:05

+0

修復..謝謝只需要myContent = ret.getPlainTextContent() – 2010-10-09 09:12:01