try {
long timestamp = System.currentTimeMillis();
String fileName = "文件名称";
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
String path = Environment.getExternalStorageDirectory() + "/文件夹名称/";
File dir = new File(path);
if (!dir.exists()) {
dir.mkdirs();
}
FileOutputStream fos = new FileOutputStream(path + fileName);
fos.write("wo shi nei rong!~ ~".getBytes());
fos.close();
}
} catch (Exception e1) {
e1.printStackTrace();
}
将数据写入SD卡
最新推荐文章于 2020-06-21 10:45:46 发布