【问题标题】:Spreadsheet API feed.getEntries() CellEntry电子表格 API feed.getEntries() CellEntry
【发布时间】:2015-08-14 16:17:39
【问题描述】:

在 Android Studio 中尝试 Google 的示例时,出现以下错误:

Error:(52, 46) error: incompatible types
required: CellEntry
found:    SpreadsheetEntry

在线:

// Iterate through each cell, printing its value.
for (CellEntry cell : feed.getEntries()) {

我使用了来自 https://developers.google.com/google-apps/spreadsheets/data 的示例“使用基于列表的提要”

另外,是否可以在不进行身份验证的情况下从公共电子表格中获取数据?

【问题讨论】:

    标签: java android google-sheets google-spreadsheet-api


    【解决方案1】:

    我可能是文档中的错字。在同一页面中还有另一个示例:

    CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class);
    
        // Iterate through each cell, printing its value.
        for (CellEntry cell : cellFeed.getEntries()) {....
    

    如您所见,包含提要的对象来自 CellFedd 类。 尝试在您的代码中检查包含结果的对象会更改它。

    向 api 发出请求时,我认为即使文件是公开的,您也必须进行身份验证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-28
      • 1970-01-01
      • 1970-01-01
      • 2012-11-30
      相关资源
      最近更新 更多