Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The duration statistics of Activity usage are incorrect. #222

Open
GaoYi123 opened this issue Feb 20, 2024 · 5 comments
Open

The duration statistics of Activity usage are incorrect. #222

GaoYi123 opened this issue Feb 20, 2024 · 5 comments

Comments

@GaoYi123
Copy link

GaoYi123 commented Feb 20, 2024

Translate the following sentence into English: "Activity usage duration statistics are performed in onStart and onStop. However, the statistics are incorrect when the Activity switches rapidly. For example, from activityA to activityB, then quickly back to activityA. This scenario can also lead to incorrect determination of foreground and background switches."

@turtledreams
Copy link
Contributor

Hi @GaoYi123 . Can you please provide more information. For example: SDK code you used for the scenario you mentioned (init time configuration for example). Also the SDK logs during the mentioned scenario. Also SDK version you are using. And more information about the environment you observed this behavior (like the emulator you used). And lastly where/how you observed the inconsistency (like expected behavior vs the observed one)

@GaoYi123
Copy link
Author

你好@GaoYi123。您能否提供更多信息。例如:您提到的场景使用的 SDK 代码(例如初始化时间配置)。 SDK 也会在上述场景中记录日志。还有您正在使用的 SDK 版本。以及有关您观察到此行为的环境(例如您使用的模拟器)的更多信息。最后,您在哪里/如何观察到不一致的情况(例如预期行为与观察到的行为)

sdkVersion : 23.12.0
device : xiaomi 11 Ultra
When ActivityA transitions to ActivityB and quickly exits ActivityB to return to ActivityA, neither the onStart nor onStop methods of ActivityA will be executed. This can lead to issues with statistics.

@GaoYi123
Copy link
Author

你好@GaoYi123。您能否提供更多信息。例如:您提到的场景使用的 SDK 代码(例如初始化时间配置)。 SDK 也会在上述场景中记录日志。还有您正在使用的 SDK 版本。以及有关您观察到此行为的环境(例如您使用的模拟器)的更多信息。最后,您在哪里/如何观察到不一致的情况(例如预期行为与观察到的行为)

When ActivityA transitions to ActivityB, the onStart method of ActivityB will call the startViewInternal method, which then calls the autoCloseRequiredViews method. The autoCloseRequiredViews method will complete the page statistics for ActivityA. However, when quickly returning to ActivityA, the onStart method of ActivityA will not be called. Even though ActivityA is currently displayed, because the onStart method of ActivityA is not called, the SDK thinks that ActivityB is currently displayed.

@GaoYi123
Copy link
Author

你好@GaoYi123。您能否提供更多信息。例如:您提到的场景使用的 SDK 代码(例如初始化时间配置)。 SDK 也会在上述场景中记录日志。还有您正在使用的 SDK 版本。以及有关您观察到此行为的环境(例如您使用的模拟器)的更多信息。最后,您在哪里/如何观察到不一致的情况(例如预期行为与观察到的行为)

The SDK calculates the number of activities to determine the foreground and background states using onResume and onStop. This situation can lead to incorrect counts because when ActivityA transitions to ActivityB, the onResume method of ActivityB will execute, but the onStop method of ActivityA may not necessarily execute.

@arifBurakDemiray
Copy link
Member

Hello @GaoYi123, we have inspected and reproduced the issue. We will look into fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants