now im trying to use this
FileOutputStream fos = getContext().openFileOutput("CalEvents", Context.MODE_PRIVATE);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(returnlist);
oos.close();
in order to save “returnlist” which is an ArrayList to the file “CalEvents”
now my question is , is that the right way to do it?
and how do i retrieve the list back?
thanks in advance
Is this what you want to do ?
EDIT: Can be simplified:
Assuming that you are in a class which extends
Context(likeActivity). If not, then you will have to call theopenFileInput()method on an object which extendsContext.