【问题标题】:Cannot resolve method无法解决方法
【发布时间】:2016-02-17 07:37:15
【问题描述】:

我正在尝试从我的 Backendless 文件中显示我的 Android Studio 项目中的“上传”文件夹。

这是代码:

Backendless.Files.listing("/Uploads", "*.docs", true, new AsyncCallback<BackendlessCollection<FileInfo>>() {
            @Override
            public void handleResponse(BackendlessCollection<FileInfo> response) {
                Iterator<FileInfo> filesIterator = response.getCurrentPage().iterator();
                while (filesIterator.hasNext()) {
                    FileInfo file = filesIterator.next();
                    String URL = file.getURL();
                    String publicURL = file.getPublicUrl();
                    Date createdOn = new Date(file.getCreatedOn());
                    String name = file.getName();
                }
            }

运行代码时出现以下错误:

Error:(34, 38) error: cannot find symbol method getURL()
Error:(35, 44) error: cannot find symbol method getPublicUrl()
Error:(36, 51) error: cannot find symbol method getCreatedOn()
Error:(37, 39) error: cannot find symbol method getName()
Error:(28, 63) error: incompatible types: <anonymous AsyncCallback<BackendlessCollection<com.example.francis.classdroid.FileInfo>>> cannot be converted to AsyncCallback<BackendlessCollection<com.backendless.files.FileInfo>>

【问题讨论】:

    标签: android backendless


    【解决方案1】:

    这里的问题是 FileInfo 类的错误导入。确保您已导入com.backendless.files.FileInfo

    如果你不知道什么是 Java 中的 import,你可以阅读更多 here。 Java 中的导入位于文件的顶部。

    【讨论】:

    • 非常感谢!我想我必须声明方法(我什至不知道在方法中做什么)来修复它。非常感谢!
    • 不要忘记接受并评价正确的答案,让其他人找到有用的答案。
    猜你喜欢
    • 2012-10-11
    • 2018-06-01
    • 1970-01-01
    • 2021-12-21
    • 2017-09-30
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多