-
Notifications
You must be signed in to change notification settings - Fork 295
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
Comments
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) |
sdkVersion : 23.12.0 |
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. |
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. |
Hello @GaoYi123, we have inspected and reproduced the issue. We will look into fixing it. |
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."
The text was updated successfully, but these errors were encountered: