【发布时间】:2019-11-21 04:17:04
【问题描述】:
设置setDestinationInExternalPublicDir()时应用崩溃
val videoDir = Environment.getDataDirectory().absolutePath + "/applicationfiles/.tutorial"
downloadRequest.setDestinationInExternalPublicDir(videoDir, videoName)
E/AndroidRuntime: 致命异常: main 进程:app.package,PID:19275 java.lang.IllegalStateException:不是标准目录之一:/data/applicationfiles/.tutorial 在 android.os.Parcel.createException(Parcel.java:2079) 在 android.os.Parcel.readException(Parcel.java:2039) 在 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188) 在 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) 在 android.content.ContentProviderProxy.call(ContentProviderNative.java:658) 在 android.content.ContentProviderClient.call(ContentProviderClient.java:558) 在 android.content.ContentProviderClient.call(ContentProviderClient.java:546) 在 android.app.DownloadManager$Request.setDestinationInExternalPublicDir(DownloadManager.java:569) 在 app.package.startDownloadingFile(ExerciseTutorialPresenter.kt:159) 在 app.package.downloadVideoFiles(ExerciseTutorialPresenter.kt:142)
【问题讨论】:
标签: android android-download-manager download-manager