File file=new File(Environment.getExternalStorageDirectory(), name); try { FileOutputStream fos=new FileOutputStream(file); fos.write(content.getBytes()); fos.close(); Toast.makeText(getApplicationContext(),"保存成功", 200).show(); }catch (Exception e) { Toast.makeText(getApplicationContext(),"保存失败", 200).show(); e.printStackTrace(); } |