在我的应用程序中,我在下面的代码中有一个与 FileOutputStream 一起存储的对象列表。此外,我的应用程序中的任何设置都与 SharedPreferences 一起存储。每当我第一次在 Google Play 商店上更新我的应用程序时(对于那些不熟悉该过程的人,我会上传新的 APK),所有使用该应用程序的人都会删除所有对象,并且所有设置都设置为默认值。为什么这样做?我怎样才能将对象存储在更新后不会消失的地方?
public ObjectStorage readListFromFile()
{
    ObjectStorage temp = null;
    String filename = "storefileobj";
    FileInputStream fis;
    try {
        fis = getActivity().openFileInput(filename);
        ObjectInputStream is = new ObjectInputStream(fis);
        temp = (ObjectStorage) is.readObject();
        is.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (StreamCorruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return temp;
}
public void updateStorage()
{
    String filename = "storefileobj";
    FileOutputStream fos;
    try {
        fos = getActivity().openFileOutput(filename, Context.MODE_PRIVATE);
        ObjectOutputStream os = new ObjectOutputStream(fos);
        os.writeObject(mainObjectList);
        os.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}