Android文件操作
2010-09-07 10:43:00 来源:WEB开发网核心提示:try{fOut =context.openFileOutput(fileName, 1);osw = new OutputStreamWriter(fOut);osw.write(data);osw.flush();Toast.makeText(context, " saved",Toast.LE
try{
fOut =context.openFileOutput(fileName, 1);
osw = new OutputStreamWriter(fOut);
osw.write(data);
osw.flush();
Toast.makeText(context, " saved",Toast.LENGTH_SHORT).show();
}
catch (Exception e)
{
e.printStackTrace();
Toast.makeText(context, " not saved",Toast.LENGTH_SHORT).show();
}
finally
{
try {
osw.close();
fOut.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
via:http://www.cnblogs.com/hxycn/archive/2010/09/07/1820872.html
更多精彩
赞助商链接