在 Android 中使用以下命令创建新目录时:context.getDir(newDir, MODE) 程序会将字符串 app_ 附加到我传递的字符串的开头in. 因此,它创建了一个名为 app_newDir 的目录,而不是字符串 newDir。
为什么要这样做?有什么办法可以避免吗?
最佳答案
它这样做是因为 the command :
abstract File getDir(String name, int mode)
Retrieve, creating if needed, a new directory in which the application can place its own custom data files.
如果你想要没有它的东西,你想使用 context.getFilesDir()
命令,并适本地附加它
关于android - 在 Android 中创建新目录会向其附加 "app_",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13615716/