Add each time an ArrayList to the serializable file
<p>I am not sure that i understand very well the serializable concept,my question is like that:</p>

<p>I Have an ArrayList of class that i call History:</p>

<pre><code>public class History implements Serializable 
{

private static final long serialVersionUID = 1L;

String nameOfMedicaments,DCI,pathologie,nameOfToCountry;
 String description;
 int DCIN;


public String getNameOfMedicaments() {
    return nameOfMedicaments;
}
public void setNameOfMedicaments(String nameOfMedicaments)
{
    this.nameOfMedicaments = nameOfMedicaments;
}

public int getDCIN() {
    return DCIN;
}
public void setDCIN(int DCIN)
{
    this.DCIN = DCIN;
}

public String getDCI() {
    return DCI;
}
public void setDCI(String DCI)
{
    this.DCI = DCI;
}
public String getPathologie() {
    return pathologie;
}
public void setPathologie(String pathologie)
{
    this.pathologie = pathologie;
}

public String getNameOfToCountry() {
    return nameOfToCountry;
}
public void setNameOfToCountry(String nameOfToCountry)
{
    this.nameOfToCountry = nameOfToCountry;
}
public String getDescription() {
    return description;
}
public void setDescription(String description)
{
    this.description = description;
}


}
</code></pre>

<p>to serialize the arrayList i use this function:</p>

<pre><code>    History history=new History();  
ArrayList&lt;History&gt; results = new ArrayList&lt;History&gt;();
     results.add(history);

            FileOutputStream fos;
            try {
                fos = openFileOutput("history", Context.MODE_PRIVATE);
                ObjectOutputStream oos = new ObjectOutputStream(fos);
                oos.writeObject(results); 
                oos.flush();
                oos.close();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }catch(IOException e){
                e.printStackTrace();
            }
</code></pre>

<p>Now i want that each time that i add an ArrayList to serialize that not going to erase the older data but to add to the older one a new array or whatever its better,  i succeed to get the last one ,</p>

<p>but i don't have any idea what i should do to get all the arrayList.</p>

<p>Thanks for Helping!!!</p>

<p>Ps:sorry for my english!!</p>
