|
|
|
@ -426,7 +426,7 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(appConfig.cmdid) && !TextUtils.isEmpty(appConfig.server) && appConfig.port != 0) {
|
|
|
|
|
if (!MicroPhotoService.isRunning && !TextUtils.isEmpty(appConfig.cmdid) && !TextUtils.isEmpty(appConfig.server) && appConfig.port != 0) {
|
|
|
|
|
Handler handler = new Handler();
|
|
|
|
|
Runnable runnable = new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
@ -436,8 +436,10 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
handler.postDelayed(runnable, noDelay != 0 ? 100 : 5000);
|
|
|
|
|
handler.postDelayed(runnable, noDelay != 0 ? 1000 : 5000);
|
|
|
|
|
}
|
|
|
|
|
binding.btnStartServ.setEnabled(!MicroPhotoService.isRunning);
|
|
|
|
|
binding.btnStopServ.setEnabled(MicroPhotoService.isRunning);
|
|
|
|
|
|
|
|
|
|
binding.tcpudp.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
@ -559,9 +561,9 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onStart() {
|
|
|
|
|
protected void onResume() {
|
|
|
|
|
// call the superclass method first
|
|
|
|
|
super.onStart();
|
|
|
|
|
super.onResume();
|
|
|
|
|
|
|
|
|
|
String logFilePath = MicroPhotoContext.buildAppDir(this.getApplicationContext());
|
|
|
|
|
logFilePath += "logs/log.txt";
|
|
|
|
@ -572,9 +574,9 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onStop() {
|
|
|
|
|
protected void onPause() {
|
|
|
|
|
// call the superclass method first
|
|
|
|
|
super.onStop();
|
|
|
|
|
super.onPause();
|
|
|
|
|
|
|
|
|
|
if (mLogFileObserver != null) {
|
|
|
|
|
mLogFileObserver.stopWatching();
|
|
|
|
|