开发者

Android device or resource busy - honeycomb

开发者 https://www.devze.com 2023-03-03 04:48 出处:网络
On the 3.0 honeycomb, I a开发者_开发技巧m getting this error when trying to access a file. It does not happen all the time. What causes is that I browse around the market a bit and then I come back to

On the 3.0 honeycomb, I a开发者_开发技巧m getting this error when trying to access a file. It does not happen all the time. What causes is that I browse around the market a bit and then I come back to my app. It tries to access a file, and i get this error:

Exception caught in com.app.android.activities.Preview$DLTask: /mnt/sdcard/tmp/1304702202502.jpg (Device or resource busy)
java.io.FileNotFoundException: /mnt/sdcard/tmp/1304702202502.jpg (Device or resource busy)
at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:239)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
at java.io.FileOutputStream.<init>(FileOutputStream.java:77)
at com.app.android.activities.Preview$DLTask.doInBackground(Preview.java:200)
at com.app.android.activities.Preview$DLTask.doInBackground(Preview.java:1)
at com.app.android.activities.appAsyncTask$2.call(appAsyncTask.java:176)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)

To get the same code working again after I restart the device, i.e. power off/on.

The same code works fine on the android version 7, but at times it crashes on v11.


I had the same issue that came out of nowhere: embedded sdcard answered with "Device or resource busy". Tried pretty much everything. Cold reboot was the only thing that helped.


It was a file system lock in my case, unplugging and re-plugging the usb cable helped me.


I figured the issue was with the folder not the file. So as a work around, I just create a new tmp folder within my app folder and try to save the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消