[代码]android文件保存范例一

      try
{
//保存路径
p = "/sdcard/" + "test" + ".png";
             //创建文件
f = new File(p);

f.createNewFile();

FileOutputStream fOut = null;
try {
fOut = new FileOutputStream(f);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}

mWorkingBitmap.compress(Bitmap.CompressFormat.PNG,100,fOut);

fOut.flush();
fOut.close();

}
catch(FileNotFoundException e)
{
e.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}

 

posted on 2012-02-10 17:19  藤藤蔓蔓  阅读(249)  评论(0编辑  收藏  举报