append data in existing file in android and read it
<p>i want to append a text in an existing file but i can not read it(i can read the first inserted data) i do not know what is the mistake .
this is the write code(save in file):</p>

<pre><code>     FileOutputStream fos = openFileOutput("test",MODE_APPEND);        
      ObjectOutputStream oos = new ObjectOutputStream(fos);

      oos.writeObject(text);

      oos.flush();

      oos.close(); 
</code></pre>

<p>and this is how to read(read the data from the file):</p>

<pre><code>     FileInputStream fis = openFileInput("test");

      ObjectInputStream ois = new ObjectInputStream(fis);
  String s=(String) ois.readObject();

      while(s != null){
     Toast.makeText(getApplicationContext(),s, Toast.LENGTH_SHORT).show();
      s=(String) ois.readObject();
      Toast.makeText(getApplicationContext(),s, Toast.LENGTH_SHORT).show(); 
      }
</code></pre>

<p>pleas help me !! are there a wrong in writing or in the reading code   </p>
