FileWriter failing and not being caught by the Catch statement
<p>here is my entire code (ps Im a noobie);</p>

<pre><code>    package xom.aaa.aaa;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class FilewritertestActivity extends Activity {
    TextView textout1, textout2, textout3;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button b1 = (Button) findViewById(R.id.button1);
        textout1 = (TextView) findViewById(R.id.textView1);
        textout2 = (TextView) findViewById(R.id.textView2);
        textout3 = (TextView) findViewById(R.id.textView3);
        b1.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //---------   OutputStreamWriter    ------------
                try {      
                        FileOutputStreamfOut=openFileOutput("settings1.dat", MODE_WORLD_READABLE);
                    OutputStreamWriter osw = new OutputStreamWriter(fOut); 
                    osw.write( "using  fileoutput stream to write this to a file");
                    osw.flush();
                    osw.close();
                }catch(Exception e){
                    e.printStackTrace(System.err);
                }
                String datax = "";
                StringBuffer buffer = new StringBuffer();

                //---------  InputStreamReader  -------------------
                try {
                    FileInputStream fIn = openFileInput("settings1.dat");
                    Reader reader = new InputStreamReader(fIn);
                    int data = reader.read();  // reads the next char
                    while(data != -1){
                        buffer.append((char)data);
                        data = reader.read();
                    }
                    reader.close();     
                } catch ( Exception e) {
                    e.printStackTrace();
                }
                textout1.setText( buffer.toString());

                //--------------- FileWriter   ---------------
                try {
                    FileWriter fw = new FileWriter("settings1.dat");
                    BufferedWriter out = new BufferedWriter(fw);
                    //BufferedWriter out = new BufferedWriter(new FileWriter("settings1.dat"));
                    out.write("a String");
                    out.close();
                } catch (Exception e){
                    e.printStackTrace();
                    textout2.setText(e.toString());
                }

            }
        });
    }
}
</code></pre>

<ol>
<li>Problem is FileWriter Not working ( for file "settings1.dat")</li>
<li>but OutputStreamWriter and InputStreamReader does work ( for file "settings1.dat")</li>
<li>the code shows writing then reading to file "settings1.dat" Is ok with Stream Witer/Reader...</li>
<li>But FileWriter  code  get error message  Filenotfoundexception "read-only file system"</li>
<li>So why does one technique work on the same File and the other doesn´t</li>
<li>Can you please tell what Iam missing -- thanks Trevor</li>
</ol>
