我在尝试将文件保存到内容时遇到问题。初始化文件似乎存在编写问题,我似乎无法弄清楚原因。我有什么遗失的吗?
我正在接受NPE:
FileOutputStream fOut = openFileOutput("runesInfo.json",MODE_WORLD_READABLE);
我的代码:
try {
FileOutputStream fOut = openFileOutput("runesInfo.json",MODE_WORLD_READABLE);
OutputStreamWriter osw = new OutputStreamWriter(fOut);
osw.write(jsonString);
osw.flush();
osw.close();
Log.d("Cache", "Cache Complete");
runesCached = true;
} catch (Exception e){
e.printStackTrace();
}