Title: [Starfish] Use a better way to determine app foreground launch · Issue #3084 · getsentry/sentry-java · GitHub
Open Graph Title: [Starfish] Use a better way to determine app foreground launch · Issue #3084 · getsentry/sentry-java
X Title: [Starfish] Use a better way to determine app foreground launch · Issue #3084 · getsentry/sentry-java
Description: Description Instead of checking for process foreground like we did earlier sentry-java/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java Line 136 in d43311a instance.appLaunchedInForeground = Conte...
Open Graph Description: Description Instead of checking for process foreground like we did earlier sentry-java/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java Line 136 in d43311a ...
X Description: Description Instead of checking for process foreground like we did earlier sentry-java/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java Line 136 in d43311a ...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/3084
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Starfish] Use a better way to determine app foreground launch","articleBody":"### Description\n\nInstead of checking for process foreground like we did earlier \r\nhttps://github.com/getsentry/sentry-java/blob/d43311af4de9697012a932ff860c9f2b2ff3d3e0/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java#L136\r\n\r\nwe could use a similar approach [as firebase](https://github.com/firebase/firebase-android-sdk/blob/28e3a6821910a0ae452fbcc5b173fafe919ddbaf/firebase-perf/src/main/java/com/google/firebase/perf/metrics/AppStartTrace.java#L552-L573).\r\n\r\nIn simplified terms this would looks like the following:\r\n```java\r\nfinal AtomicBoolean anyActivityCreated = new AtomicBoolean(false);\r\nregisterActivityLifecycleCallbacks(new ActivityLifecycleCallbacksAdapter() {\r\n @Override\r\n public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {\r\n super.onActivityCreated(activity, savedInstanceState);\r\n anyActivityCreated.set(true);\r\n unregisterActivityLifecycleCallbacks(this);\r\n }\r\n});\r\nnew Handler(Looper.getMainLooper()).post(() -> {\r\n final boolean isForegroundAppLaunch = anyActivityCreated.get();\r\n Log.e(TAG, \"onCreate: isForegroundAppLaunch: \" + isForegroundAppLaunch);\r\n});\r\n```","author":{"url":"https://github.com/markushi","@type":"Person","name":"markushi"},"datePublished":"2023-12-05T12:41:30Z","url":"https://github.com/getsentry/sentry-java/issues/3084"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:75de8c8d-93fa-1f80-ba33-d0087e57edee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CFE:E046C:88137A:BEC0E9:6B0480B2 |
| html-safe-nonce | e879b9acbccdc1f10e45bd31deeea4cdbba94707a3a1380d37baf722086b40be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0ZFOkUwNDZDOjg4MTM3QTpCRUMwRTk6NkIwNDgwQjIiLCJ2aXNpdG9yX2lkIjoiNTAwNTk3MjI5NDM5NzYyNDQ5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e63a0d44446bd1b6e62fdc235ec7c2ba7f1e3b9b5c8e3dc8ed29e0a8848c5b2e |
| hovercard-subject-tag | issue:2026107166 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/3084/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3002b91796a2f7875e60697ac6509456d881c695e9de68d5c179014ca8e8555/getsentry/sentry-java/issues/3084 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3002b91796a2f7875e60697ac6509456d881c695e9de68d5c179014ca8e8555/getsentry/sentry-java/issues/3084 |
| og:image:alt | Description Instead of checking for process foreground like we did earlier sentry-java/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java Line 136 in d43311a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markushi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width