private void saveInfo2Memory(String message, String fileName) { StringBuffer sb = new StringBuffer(); sb.append(message); if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { String path = GlobalApplication.getInstance().getApplicationContext().getFilesDir().getAbsolutePath() + "/"; File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } sb.append("\n");//mac FileOutputStream fos; try { fos = new FileOutputStream(path + fileName, true); fos.write(sb.toString().getBytes()); fos.close(); } catch (IOException e) { e.printStackTrace(); } } }
保存app信息到手机存储
最新推荐文章于 2023-07-07 10:25:59 发布