Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
该目录无法在 android 4.4.2 中写入
File pdfDir=newFile(Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_PICTURES),"PdfFolder");
另外,我使用了清单WRITE_EXTERNAL_STORAGE
如果您的应用程序已请求 WRITE_EXTERNAL_STORAGE 权限,那么即使在 KitKat 中也始终允许写入 Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),因为 getExternalStoragePublicDirectory() 指向外部存储,它不是可移动存储(“SDCard”)绝大多数设备。
File file = new File(getExternalFilesDir(null), "PdfFolder")
这对我有用。