diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleViews.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleViews.java index dea31b57..756a2a8a 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleViews.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleViews.java @@ -165,7 +165,7 @@ void autoCloseRequiredViews(boolean closeAllViews, Map customVie firstView = false; } - recordView(0.0, viewSegmentation); + recordView(currentViewID, 0.0, viewSegmentation); return currentViewData.viewID; } @@ -191,14 +191,14 @@ void stopViewWithIDInternal(@Nullable String viewID, @Nullable Map segmentation) { - ModuleEvents.Events events = Countly.instance().events(); + void recordView(String id, Double duration, Map segmentation) { + ModuleEvents events = internalConfig.sdk.module(ModuleEvents.class); if (events == null) { L.e("[ModuleViews] recordView, events module is not initialized"); return; } - events.recordEvent(KEY_VIEW_EVENT, segmentation, 1, 0.0, duration); + events.recordEventInternal(KEY_VIEW_EVENT, 1, 0.0, duration, segmentation, id); } void recordViewEndEvent(ViewData vd, @Nullable Map filteredCustomViewSegmentation, String viewRecordingSource) { @@ -220,7 +220,7 @@ void recordViewEndEvent(ViewData vd, @Nullable Map filteredCusto long viewDurationSeconds = lastElapsedDurationSeconds; Map segments = createViewEventSegmentation(vd, false, false, filteredCustomViewSegmentation); - recordView(new Long(viewDurationSeconds).doubleValue(), segments); + recordView(vd.viewID, new Long(viewDurationSeconds).doubleValue(), segments); } void pauseViewWithIDInternal(String viewID) {