我正在尝试创建一个auto-backup应用,其中从Camera拍摄的所有照片都将上传到Cloudinary。但是,我似乎无法让我的代码工作。我究竟做错了什么?在Android Studio中获取相机镜头
class UploadPhotos implements Runnable {
@Override
public void run() {
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
File[] listOfFiles = storageDir.listFiles();
if (listOfFiles != null) {
System.out.println("code does not get this far");
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
System.out.println("File " + listOfFiles[i].getName());
try {
cloudinary.uploader().upload(listOfFiles[i], ObjectUtils.emptyMap());
System.out.print(listOfFiles[i] + " should have uploaded");
} catch (IOException e) {
e.pri