【发布时间】:2010-09-02 09:38:15
【问题描述】:
我正在尝试使用 openFileOutput 函数,但它无法编译并且无法识别该函数。我正在使用安卓 SDK 1.6。这是一个sdk问题吗?这是参数问题吗?
import java.io.FileOutputStream;
public static void save(String filename, MyObjectClassArray[] theObjectAr) {
FileOutputStream fos;
try {
fos = openFileOutput(filename, Context.MODE_PRIVATE);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(theObjectAr);
oos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
}
【问题讨论】: