Tuesday, 20 August 2013

FileWriter may or may not be creating file?

FileWriter may or may not be creating file?

I'm working on an app for my Kindle Fire, and I'm just trying to test
writing a file, and opening it up again for now. The saving process
APPEARS to be working fine, but whenever I try to press the load button,
it throws a FileNotFoundExeception and a subsequent NullPointerExeception
when I try to use it.
I say it appears to be working fine because I can't actually view the
directory on my kindle, there's just no errors thrown when I press the
save button. The directory is listed as
/mnt/sdcard/Android/data/portalboat.concept/files/BLUH.txt, but as soon as
I click on the Android folder in that /mnt/sdcard directory, it just
redirects me to /sdcard/Android, not /mnt/sdcard/Android. There's nothing
there in the complete directory I can view, but I'm not sure if it's the
same one.
I've run mkdirs() and createNewFile(), and there's no errors being thrown,
so one would think that the file is being created. But apparently it
isn't, because I get a FileNotFoundExeception when I try to load it using
the EXACT SAME File class creation line.
Does anyone have any idea on what could be causing this?
http://pastebin.com/Kn93Y73X <- SaveText is the saving function and
LoadText is the loading function, obviously.
http://pastebin.com/WzYUKWAb <- The error dump.

No comments:

Post a Comment