My program contains a file with the name "size.txt", which contains just a word "15". If a user choose a value from a spinner,say 17, then the chosen value should be stored in the file and replace "15". 

I have added the permission to the program

```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>

```

But somehow i can not make the chosen value be written to the file. Here is my code

```
try {
    FileOutputStream fos = openFileOutput("size", Context.MODE_PRIVATE);
    OutputStreamWriter osw = new OutputStreamWriter(fos);
    osw.write("17");
    osw.flush();
    osw.close();
} catch (java.io.IOException e) {
//do something if an IOException occurs.
}

```

Can anybody help me? Thank youvery much!