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

Demo app: don't start the main activity again, just finish the current one #604

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

magda-woj
Copy link
Contributor

Basically the title. I don't think we should be starting the main activity again, when clicking the Exit button on another activity. Just finishing the current activity seems to work fine. The motivation to look into this were multiple App start spans emitted by the app. After those changes it doesn't happen, there are Restarted spans for the main activity instead. The behaviour after the change is identical to the one using the phone's build-in "go back" button while on the first screen of a non-main activity.

@magda-woj magda-woj requested a review from a team as a code owner September 18, 2024 19:48
@LikeTheSalad
Copy link
Contributor

multiple App start spans emitted by the app

I agree we shouldn't relaunch the main activity, so thanks for these changes! However, I was also curious why doing so would trigger a new app launch event. I found this part of the code where I think it's happening and it looks like the logic is to create the event every time the "initial activity" starts, which doesn't seem like a good idea to trigger it (there are also some comments there acknowledging so) so maybe we should do some work in the future to properly cover the "hot" app start case.

@breedx-splk breedx-splk merged commit 55186e4 into open-telemetry:main Sep 19, 2024
3 checks passed
@breedx-splk
Copy link
Contributor

I opened this issue to track the AppStart thing: #606

@magda-woj magda-woj deleted the not-start-main branch September 25, 2024 10:23
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

Successfully merging this pull request may close these issues.

3 participants