简体   繁体   English

不同厂家的区别

[英]Difference between different manufacturers

Currently I am working with files in android and in order to create directory I used mkdir() command.目前我正在处理 android 中的文件,为了创建目录,我使用了 mkdir() 命令。 The issue is, it worked on devices like Samsung,LG,Pixel and few others while it didn't work in One Plus of same API version.问题是,它在三星、LG、Pixel 等设备上运行,而在相同 API 版本的一加中不起作用。 Replacing mkdir() with mkdirs() made it to work in one plus also.用 mkdirs() 替换 mkdir() 使其在一加中也能工作。 I would like to know how this varies from manufacturer to manufacturer.我想知道这如何因制造商而异。

那是因为每个制造商的根文件夹都不同,所以当您调用 mkdirs() 时,它将为您的文件创建父文件夹,因此您无需自己处理它们

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM