更新时间:2022-05-03 01:33:28
您无权直接访问外部存储不可移动存储.
You do not have direct filesystem access to arbitrary locations on removable storage, starting with Android 4.4. WRITE_EXTERNAL_STORAGE
is meaningless here, as external storage is not removable storage.
改用Storage Access Framework(ACTION_OPEN_DOCUMENT_TREE
和kin).或者,将您的工作限制为作为getExternalFilesDirs()
,getExternalCacheDirs()
和getExternalMediaDirs()
的一部分返回的可移动存储位置(Context
上的所有方法).
Use the Storage Access Framework (ACTION_OPEN_DOCUMENT_TREE
and kin) instead. Or, limit your work to the removable storage locations returned as part of getExternalFilesDirs()
, getExternalCacheDirs()
, and getExternalMediaDirs()
(all methods on Context
).