|
|
|
@ -30,6 +30,7 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
|
int initres = intent.getIntExtra("initres", 0);
|
|
|
|
|
initres = 1;
|
|
|
|
|
if (initres != 0) {
|
|
|
|
|
mHandler = new Handler();
|
|
|
|
|
Runnable runnable = new Runnable() {
|
|
|
|
@ -95,7 +96,8 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
tmpDestPath = new File(tmpDestPath, "mpdata");
|
|
|
|
|
if (tmpDestPath.exists()) {
|
|
|
|
|
try {
|
|
|
|
|
tmpDestPath.delete();
|
|
|
|
|
FilesUtils.delete(tmpDestPath);
|
|
|
|
|
tmpDestPath.mkdirs();
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -198,7 +200,11 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
int len = -1;
|
|
|
|
|
byte[] buffer = new byte[1024];
|
|
|
|
|
while ((len = inputStream.read(buffer)) != -1) {
|
|
|
|
|
try {
|
|
|
|
|
fos.write(buffer, 0, len);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fos.flush();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|