Hello,

First: Merry christmas :)

Second:
I have one customer where saving my applications data to a file works
as expected, but loading the data from the file always causes a
FileNotFoundException.
Uninstalling and reinstalling has no effect - i.e. the file can be
written but reading it fails.
I can't reproduce the problem. Now i hope you can help me with some
advice.

This is how the data gets saved:
FileOutputStream fos = contextVar.openFileOutput(FILENAME,
Context.MODE_PRIVATE);
DataOutputStream out = new DataOutputStream(fos);
out.writeInt(version);
...

And this is how the data is loaded:
FileInputStream fis = contextVar.openFileInput(FILENAME);
DataInputStream in = new DataInputStream(fis);
version = in.readInt();
...

contextVar holds a reference of the applications context from onCreate
().
Loading happens before setContentView() is called.
Loading/saving is done on different threads.

Do you have any ideas why loading the previously saved file fails?
Any advice is welcome!
Thanks,
Mike

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to