【发布时间】:2014-03-11 13:47:20
【问题描述】:
我在 Android 应用中使用 Dropbox Sync API 将照片放在 Dropbox 上。 照片存储在 DbxFile 中。创建文件后,我可以立即重新打开它们而没有任何问题,但是一旦文件上传,我无法在移动设备上打开大约一半的文件。 (在我的电脑上,它们没问题。) 对于不再可访问的文件,Sync api 似乎知道有一个更新的版本,但由于某种原因它们没有更新。
public Bitmap getBitmapFromFile(String path) throws Exception {
DbxFile dbxFile = dbxFileSystem.open(new DbxPath(path));
DbxFileStatus newerStatus = dbxFile.getNewerStatus();
if (newerStatus != null && newerStatus.isCached) {
// this is +/- one-half of the time the case. Appears to be random?
dbxFile.update(); //This is executed, but no update??
}
Bitmap bitMap = BitmapFactory.decodeStream(dbxFile.getReadStream());
dbxFile.close();
return bitMap;
}
当我尝试打开不再可访问的文件时,LogCat 中出现以下行:
libDropboxSync.so(open) file.cpp:329: opening at (da618e76aab is latest)
通过打开文件没有问题,出现以下行:
libDropboxSync.so(open) file.cpp:336: opening at da418e76aab (latest)
为什么不执行更新? 非常感谢任何帮助,谢谢。
【问题讨论】:
标签: android dropbox dropbox-api