1、 权限
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
2、创建文件
File newFile=new File(newPath);
File parentFile = newFile.getParentFile();
if(!parentFile.exists()){
parentFile.mkdirs();
}
f(!newFile.exists()){
newFile.createNewFile();
}
3、clean项目
4、重启盒子(不知道原因,有时会报标题中的异常,因为socket没有及时释放)