【问题标题】:W/DownloadManager( 7621): Aborting request for download 11:W/DownloadManager(7621):中止下载请求 11:
【发布时间】:2012-10-19 03:36:33
【问题描述】:
E/UpdatesSettings( 7146): File write failed: java.io.IOException: open failed: EBUSY (Device or resource busy)
I/DownloadManager( 7621): Initiating request for download 11
W/DownloadManager( 7621): Aborting request for download 11: while opening destination file: java.io.FileNotFoundException: /storage/sdcard0/sysupdater/***.partial: open failed: EBUSY (Device or resource busy)
D/DownloadManager( 7621): cleanupDestination() deleting /storage/sdcard0/sysupdater/***.partial

我使用DownloadManager 下载文件,有时会这样。谁能告诉我为什么以及如何解决这个问题??

【问题讨论】:

    标签: android ioexception download-manager


    【解决方案1】:

    我也遇到过类似的问题。

    为避免 FileNotFoundException,请确保:

    1. 添加写入外部存储所需的权限(如果这是您尝试保存的位置),请将以下内容添加到 AndroidManifest.xml:

      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      
    2. 创建您尝试下载到的子文件夹:

      File folder = new File(FOLDER_PATH);
      if (!folder.exists()) {
          folder.mkdir();
      }
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 2014-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多