修复目录不存在时的bug

serial
Matthew 2 years ago
parent 05b0199819
commit 0b7e613ebd

@ -430,10 +430,14 @@ public class MainActivity extends AppCompatActivity {
private void saveAppConfig(String cmdid, String server, int port, int protocol, int networkProtocol) { private void saveAppConfig(String cmdid, String server, int port, int protocol, int networkProtocol) {
String appPath = MicroPhotoService.buildAppDir(this.getApplicationContext()); String appPath = MicroPhotoService.buildAppDir(this.getApplicationContext());
OutputStreamWriter outputStreamWriter = null; OutputStreamWriter outputStreamWriter = null;
try { try {
File dataPath = new File(appPath + "data/");
if (!dataPath.exists()) {
dataPath.mkdirs();
}
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("CMDID", cmdid); jsonObject.put("CMDID", cmdid);
jsonObject.put("Server", server); jsonObject.put("Server", server);

Loading…
Cancel
Save