android: file does not stay written
<p>Here are the relevant bits of my code</p>

<pre><code>public void Toast(String text)
{
    Toast toast = Toast.makeText(this,text, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL, 0, 0);
    toast.show();
}
//Within another function
File rootPath = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
if(!rootPath.exists())
{
    if(!rootPath.mkdir())
    {
        Toast("Failed to create directory");
        return;

    }
}
File file = new File(rootPath,"rtsd.csv");
String p = file.getAbsolutePath();
BufferedWriter f = new BufferedWriter(new FileWriter(file,true));
Toast(data);
f.write(data);
f.flush();
f.close();
MediaScannerConnection.scanFile(this.getBaseContext(), new String[]{p}, null, null);
FileReader fIn = new FileReader(file);
CharBuffer buffer = CharBuffer.allocate((int)file.length());
fIn.read(buffer);
fIn.close();
Toast("Read Test\n"+buffer.toString()+"\nFrom\n"+p);
Toast("Submission Successful");
</code></pre>

<p>I was having trouble with another part of this application that relied on this writing correctly, so i decided to see what the writing section had to say about it.
One would think that it my it would toast back whatever i just wrote to it. but instead, it just reads back a blank line.
Is there any possible reason for this? I have set permissions correctly, and i can even view the file when i plug the device into USB, but the application seems to be unable to read any file it writes.
Thanks in advance for any help.</p>
