嗨,我开发了一个支持 Dropbox 的应用程序。
我完成了身份验证,一切正常。
当我关闭互联网连接并尝试上传文件时,我收到成功回调...!!!
之后,如果我打开互联网,什么都不会发生。
这是事情必须发生的方式还是我在某个地方错了?
这是我用于上传的代码
FileInputStream inputStream = null;
try {
File file = new File("/path to my file.txt");
inputStream = new FileInputStream(file);
Entry newEntry = mDBApi.putFileOverwrite("/path to my file.txt", inputStream, file.length(), null);
Log.i("DbExampleLog", "The uploaded file's rev is: " + newEntry.rev);
} catch (DropboxUnlinkedException e) {
// User has unlinked, ask them to link again here.
Log.e("DbExampleLog", "User has unlinked.");
} catch (DropboxException e) {
Log.e("DbExampleLog", "Something went wrong while uploading.");
} catch (FileNotFoundException e) {
Log.e("DbExampleLog", "File not found.");
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {}
}
}