- added audio and motion detection again

This commit is contained in:
Oliver Kleinecke 2023-06-21 19:36:20 +02:00
parent c8b947bb57
commit 0948d7f44f

View File

@ -78,7 +78,9 @@ public class MainActivity extends AppCompatActivity {
detectorService.videoDetector.startDetection(); detectorService.videoDetector.startDetection();
} }
} else { } else {
detectorService.videoDetector.stopDetection(); if(detectorService != null) {
detectorService.videoDetector.stopDetection();
}
} }
} }
}); });
@ -86,9 +88,13 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (toggleAudio.isChecked()) { if (toggleAudio.isChecked()) {
if(detectorService != null) {
detectorService.audioDetector.startDetection();
}
} else { } else {
if(detectorService != null) {
detectorService.audioDetector.stopDetection();
}
} }
} }
}); });
@ -96,9 +102,13 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (toggleBewegung.isChecked()) { if (toggleBewegung.isChecked()) {
if(detectorService != null) {
detectorService.motionDetector.startDetection();
}
} else { } else {
if(detectorService != null) {
detectorService.motionDetector.stopDetection();
}
} }
} }
}); });