更改导致异常的文件名

时间:2014-12-01 18:05:43

标签: java android file-management

我正在将文件名的字符串常量从InternalString更改为Location。这导致以下错误:

12-01 12:58:47.555:W / System.err(6405):java.io.FileNotFoundException:/ data / data / com.example.app3 / files / Location:open failed:ENOENT(没有这样的文件或目录)

代码导致错误:

字符串FILENAME =“位置”;

try {
    InputStream fis = openFileInput(FILENAME);
    byte[] dataArray = new byte[fis.available()];
    while (fis.read(dataArray) != -1)
    {
        String text = new String(dataArray);
        tvCoordinates = (TextView) findViewById(R.id.tvcoordinates);
        tvCoordinates.setText(text);
    }

} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

1 个答案:

答案 0 :(得分:1)

  

java.io.FileNotFoundException:   /data/data/com.example.app3/files/InternalLocation

首先, InternalLocation!=位置

对于另一个......文件是否已存在于此位置?

相关问题