Title: fix(android/application): open windows after the original activity finishes by rafaelaugustos · Pull Request #11552 · NativeScript/NativeScript · GitHub
Open Graph Title: fix(android/application): open windows after the original activity finishes by rafaelaugustos · Pull Request #11552 · NativeScript/NativeScript
X Title: fix(android/application): open windows after the original activity finishes by rafaelaugustos · Pull Request #11552 · NativeScript/NativeScript
Description: PR Checklist The PR title follows the commit guidelines. There is an issue for the bug: #11526. You have signed the CLA. All existing Core unit tests pass (544 passed, 1 skipped). Tests for the changes are included. What is the current behavior? After the original Android Activity finishes, startActivity can be cleared while a secondary NativeWindow remains usable. openWindow() then targets the hard-coded org.nativescript.NativeScriptActivity, which may not be declared in the manifest, and throws ActivityNotFoundException. What is the new behavior? Resolve the target from a live NativeScript Activity: the original Activity, the foreground Activity, or an attached surviving window. Exclude finishing/destroyed Activities, windows whose native surfaces are gone, and SDK Activities without the NativeScript marker. If none remains, use the application's configured launch component; report a clear error when it has no launch component instead of starting an undeclared class. The existing window flags and payload delivery are preserved. This changes Android target selection only; there is no public API change. Closes #11526. Validation Added 10 regression cases for surviving windows, original/foreground Activity selection, SDK Activities, finishing/destroyed Activities, detached surfaces, configured launch components and the missing-launcher error. Against the original implementation, 9 of these cases fail. npx nx run core:test: 544 passed, 1 skipped, across 42 test files. npx nx run core:build: passed, before and after the fix. npx nx format:write --files=packages/core/application/application.android.ts,packages/core/application/open-window.android.spec.ts,packages/core/vitest.setup.ts: passed. Android 16 / API 36 arm64 emulator, NativeScript Android runtime 9.1.1, Core built from 3224f1b, com.tns.NativeScriptActivity, launchMode="standard": reproduced using an isolated native app with a window content resolver, without the router. The native app opens a second window, finishes the original Activity, then requests another window from the survivor after activityDestroyed: Before the final open request (both builds): startActivity=false, foregroundActivity=true, windows=1 Original Core: ActivityNotFoundException: {org.nativescript.openwindow11526/org.nativescript.NativeScriptActivity} Patched Core: {"ok":true,"windows":2,"originalDestroyed":true, "payload":"after-primary-finished","flags":403177472} The complete native automated app suite and an iOS simulator run were not executed locally. The native before/after check above and the full Core unit suite were executed.
Open Graph Description: PR Checklist The PR title follows the commit guidelines. There is an issue for the bug: #11526. You have signed the CLA. All existing Core unit tests pass (544 passed, 1 skipped). Tests for t...
X Description: PR Checklist The PR title follows the commit guidelines. There is an issue for the bug: #11526. You have signed the CLA. All existing Core unit tests pass (544 passed, 1 skipped). Tests for t...
Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11552
X: @github
Domain: github.com
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:51bd1cc8-0b05-729a-68c6-62d458a29be0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E15E:20AA01:1AD73F3:2219BEE:6B013A43 |
| html-safe-nonce | aaa3660329c235a2a153a3926ab38c5cbc7d5ce5afb14fc37ee3c5abadf99330 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTVFOjIwQUEwMToxQUQ3M0YzOjIyMTlCRUU6NkIwMTNBNDMiLCJ2aXNpdG9yX2lkIjoiNDkwODk2NTIwOTU2NzIxNDE0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 32be904e5e57a383beafcfd5b6b1079583ce8b7b50782c9ee1da55f6f498dc06 |
| hovercard-subject-tag | pull_request:4915235234 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/NativeScript/NativeScript/pull/11552/files |
| twitter:image | https://avatars.githubusercontent.com/u/5261655?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5261655?s=400&v=4 |
| og:image:alt | PR Checklist The PR title follows the commit guidelines. There is an issue for the bug: #11526. You have signed the CLA. All existing Core unit tests pass (544 passed, 1 skipped). Tests for t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width