I am getting this error at openFileOutput(FILENAME, Context.MODE_PRIVATE);
I used this code before, I don't know why it's not working now. The error reads: Method openFileOutput(String, int) is undefined for the type SaveProjects
package com.example.musicvideomaker;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import android.content.Context;
import android.util.Log;
import com.example.musicvideomaker.Projects;
public class SaveProjects {
FileOutputStream fos;
public ArrayList<Projects> Projects;
public void saveProject(Projects project, String FILENAME)
{
this.Projects.add(project);
try
{
fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
ObjectOutputStream os = new ObjectOutputStream(fos);
os.writeObject(this);
os.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
}