我有以下代码可写入应用程序的目录。
FileOutputStream fos = getApplicationContext().openFileOutput("entries.ser", Context.MODE_PRIVATE);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(hm);
//Read file code
FileInputStream fileInputStream = new FileInputStream(getContext().getFilesDir()+"/entries.ser");
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
hm = (LinkedHashMap) objectInputStream.readObject();
问题是当我更新应用程序时,它不再从以前的应用程序版本中读取保存的文件。我该如何解决?
NEWBIE HERE