我正在尝试将图像插入 Parse 云,但出现错误这是我的代码:
public void uploadImage() {
File f = new File("/mnt/sdcard/test.jpg");
Bitmap bmp = BitmapFactory.decodeFile(f.getAbsolutePath());
ParseFile file = new ParseFile("test.jpg",bitmapToByteArray(bmp));
file.saveInBackground();
test = new ParseObject("Testing");
test.put("images", file);
test.saveInBackground();
}
以及来自 LogCat 的错误代码:
02-25 12:08:53.259: E/AndroidRuntime(12444): FATAL EXCEPTION: AsyncTask #2
02-25 12:08:53.259: E/AndroidRuntime(12444): java.lang.RuntimeException: An error occured while executing doInBackground()
02-25 12:08:53.259: E/AndroidRuntime(12444): at android.os.AsyncTask$3.done(AsyncTask.java:200)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.lang.Thread.run(Thread.java:1096)
02-25 12:08:53.259: E/AndroidRuntime(12444): Caused by: java.lang.RuntimeException: This query has an outstanding network connection. You have to wait until it's done.
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseFile.assertNotRunning(ParseFile.java:126)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseFile.save(ParseFile.java:264)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseFile.save(ParseFile.java:258)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseObject.deepSave(ParseObject.java:1527)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseObject.save(ParseObject.java:924)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseObject$5.run(ParseObject.java:957)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.ParseObject$5.run(ParseObject.java:954)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.BackgroundTask.doInBackground(BackgroundTask.java:39)
02-25 12:08:53.259: E/AndroidRuntime(12444): at com.parse.BackgroundTask.doInBackground(BackgroundTask.java:1)
02-25 12:08:53.259: E/AndroidRuntime(12444): at android.os.AsyncTask$2.call(AsyncTask.java:185)
02-25 12:08:53.259: E/AndroidRuntime(12444): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-25 12:08:53.259: E/AndroidRuntime(12444): ... 4 more
我不知道是什么导致了错误,请帮助我并提前感谢