Skip to content

Commit 4862c83

Browse files
feat: usage of the option
1 parent 17f6e8f commit 4862c83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sdk/src/main/java/ly/count/android/sdk/ModuleViews.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ModuleViews extends ModuleBase implements ViewIdProvider {
2020
String currentViewName = "";
2121
private boolean firstView = true;
2222
boolean autoViewTracker = false;
23+
boolean restartManualViews = true;
2324
boolean automaticTrackingShouldUseShortName = false;
2425

2526
//track orientation changes
@@ -84,6 +85,7 @@ static class ViewData {
8485
setGlobalViewSegmentationInternal(config.globalViewSegmentation);
8586
autoTrackingActivityExceptions = config.automaticViewTrackingExceptions;
8687
trackOrientationChanges = config.trackOrientationChange;
88+
restartManualViews = !config.disableViewRestartForManualRecording;
8789

8890
viewsInterface = new Views();
8991
}
@@ -552,7 +554,7 @@ void onActivityStopped(int updatedActivityCount) {
552554
}
553555
}
554556

555-
if (updatedActivityCount <= 0) {
557+
if (updatedActivityCount <= 0 && (autoViewTracker || restartManualViews)) {
556558
//if we go to the background, stop all running views
557559
stopRunningViewsAndSend();
558560
}
@@ -587,8 +589,7 @@ void onActivityStarted(Activity activity, int updatedActivityCount) {
587589
}
588590
}
589591

590-
if (updatedActivityCount == 1) {
591-
//if we go to the background, stop all running views
592+
if (updatedActivityCount == 1 && (autoViewTracker || restartManualViews)) {
592593
startStoppedViews();
593594
}
594595
}

0 commit comments

Comments
 (0)