相关疑难解决方法(0)

android openFileOutput有什么问题?

我正在尝试使用openFileOutput函数但它不编译并且无法识别该函数.我正在使用android 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();
    }
}
Run Code Online (Sandbox Code Playgroud)

java android

31
推荐指数
2
解决办法
8万
查看次数

标签 统计

android ×1

java ×1