Repository navigation
fix(android/application): open windows after the original activity finishes - #11552
Open
rafaelaugustos wants to merge 1 commit into
Open
rafaelaugustos wants to merge 1 commit into
rafaelaugustos wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Checklist
What is the current behavior?
After the original Android Activity finishes,
startActivitycan be cleared while a secondary NativeWindow remains usable.openWindow()then targets the hard-codedorg.nativescript.NativeScriptActivity, which may not be declared in the manifest, and throwsActivityNotFoundException.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
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.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: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.