Android的Context.openFileOutput()使用什么文件系统路径?

Oll*_*e C 48 android

我无法理解为什么答案不在Android开发者文档中; 我发现他们一直很沮丧.

重新使用Context类上的openFileOutput()方法来打开要写入的文件,它写入哪个内部存储文件路径?

http://developer.android.com/reference/android/content/Context.html

http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

Com*_*are 63

重新使用Context类上的openFileOutput()方法来打开要写入的文件,它写入哪个内部存储文件路径?

它指向哪里getFilesDir()Context回报.您可以这样说,因为文档说:

返回文件系统上目录的绝对路径,其中存储使用openFileOutput(String,int)创建的文件.


Cra*_*eng 15

在DDMS中,我发现我的文件位于:

data > data > your app id > files
Run Code Online (Sandbox Code Playgroud)

  • 你的手机需要扎根.Orelse数据文件夹将显示为空. (4认同)
  • 我的数据文件夹看起来总是空的,知道我可能缺少什么? (2认同)