GeezerVison is showing github.com — fix(android/application): open windows after the original activity finishes by rafaelaugustos · Pull Request #11552 · NativeScript/NativeScript
Conversation
PR Checklist
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 21, 2026
nx-cloud
Bot
commented
Oct 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
View your CI Pipeline Execution ↗ for commit c7d321d
| Command |
Status |
Duration |
Result |
nx run-many -t build -p core,webpack5,vite |
✅ Succeeded |
16s |
View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-11-12 02:13:23 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pkg-pr-new
Bot
commented
Oct 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Open in StackBlitz
npm i https://pkg.pr.new/@nativescript/core@11552
npm i https://pkg.pr.new/@nativescript/vite@11552
npm i https://pkg.pr.new/@nativescript/webpack@11552
commit: c7d321d
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|