Title: [Android] Blank screen when a new activity adopts a shared root view before the old one stops · Issue #11615 · NativeScript/NativeScript · GitHub
Open Graph Title: [Android] Blank screen when a new activity adopts a shared root view before the old one stops · Issue #11615 · NativeScript/NativeScript
X Title: [Android] Blank screen when a new activity adopts a shared root view before the old one stops · Issue #11615 · NativeScript/NativeScript
Description: Issue Description Runtime bug on Android. An app that uses one root view across activities can show a blank screen when it is reopened. Android can start a new activity before the old one stops. The new activity adopts the root view, and...
Open Graph Description: Issue Description Runtime bug on Android. An app that uses one root view across activities can show a blank screen when it is reopened. Android can start a new activity before the old one stops. Th...
X Description: Issue Description Runtime bug on Android. An app that uses one root view across activities can show a blank screen when it is reopened. Android can start a new activity before the old one stops. Th...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/11615
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Android] Blank screen when a new activity adopts a shared root view before the old one stops","articleBody":"### Issue Description\n\nRuntime bug on Android. An app that uses one root view across activities can show a blank screen when it is reopened.\n\nAndroid can start a new activity before the old one stops. The new activity adopts the root view, and then the old activity's `onStop` unloads that same view. If the old activity is finishing, its `onDestroy` also destroys the view. The view also keeps the old activity's FragmentManager, so the frame does not create a fragment in the new activity.\n\nAn app reaches this state when `Application.run({ create })` returns the same view each time. Timing decides whether it happens, so it looks intermittent. Routing is not required.\n\nExpected behavior: the reopened app shows its page.\n\nRelated case with the same cause:\n\n- Returning to an older activity after a newer one took the root view also shows a blank screen.\n\nApps with no main entry have a separate failure on a quick reopen. `exit` has not fired, so `launch` does not fire, and nothing supplies a root view.\n\nI saw blank screens in Angular and Vue apps, and possibly Solid. I reproduced the blank screen with `@nativescript/core` only, using no framework code. I have not confirmed the cause in a real Angular, Vue, or Solid app.\n\nRelated:\n\n- #11572 and #11573 cover a reopen after `exit`, which is a different case from this one.\n- #11352 (draft) covers a crash in `findPageForFragment`. I reproduced that crash by recreating a stopped older activity after its root view moved. I have not tested #11352 against it.\n- #11591 also affects recreated activities, but it has a different cause.\n\n### Reproduction\n\nUse `apps/toolbox` from this repository and replace `src/main.ts`:\n\n```ts\nimport { Application, Frame } from '@nativescript/core';\n\nlet root: Frame;\n\nApplication.run({\n create() {\n if (!root) {\n root = new Frame();\n root.navigate({ moduleName: 'main-page' });\n }\n return root;\n },\n});\n```\n\n1. Run the app with `ns run android`.\n2. Wait for the main page to appear.\n3. Start a second activity:\n\n ```shell\n adb shell am start -f 0x08000000 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.nativescript.ToolBox/com.tns.NativeScriptActivity\n ```\n\n4. The screen stays blank.\n\nThe same blank screen appears with Back and an immediate reopen. On the main page, run:\n\n```shell\nadb shell \"input keyevent KEYCODE_BACK; am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.nativescript.ToolBox/com.tns.NativeScriptActivity\"\n```\n\nEach of these two commands gave a blank screen in 5 of 5 trials. The app stayed in focus, the screen was still blank after 15 seconds, and the app did not crash.\n\nWaiting 5 seconds between Back and the reopen does not reproduce it with this `main.ts` (3 of 3 trials showed the page), because the old activity is gone by then.\n\n### Relevant log output (if applicable)\n\nAndroid event log for Back with an immediate reopen. The new activity starts before the old one stops:\n\n```shell\nwm_on_create_called: [199554052, com.tns.NativeScriptActivity]\nwm_on_start_called: [199554052, com.tns.NativeScriptActivity]\nwm_on_stop_called: [260012955, com.tns.NativeScriptActivity]\nwm_on_destroy_called: [260012955, com.tns.NativeScriptActivity]\n```\n\n### Environment\n\n- `@nativescript/core`: built from `main` at `07e84ec58` (9.1.4-next.4)\n- `@nativescript/android`: 9.1.1\n- Device: Android emulator, API 36, x86_64\n- OS: Windows 11\n","author":{"url":"https://github.com/herefishyfish","@type":"Person","name":"herefishyfish"},"datePublished":"2026-11-05T00:53:59Z","url":"https://github.com/NativeScript/NativeScript/issues/11615"}
| 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:6f6d8959-5e09-873b-4fb6-98c08bab32bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF74:1EB1:3ACFE3:4D20BA:6B012FD3 |
| html-safe-nonce | b31d5187473bf062a834e0b02313a591705e131522a4334cec0972384334dc85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjc0OjFFQjE6M0FDRkUzOjREMjBCQTo2QjAxMkZEMyIsInZpc2l0b3JfaWQiOiIzOTUxMDU4NTkzNDEwNzg5MzMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 92be87d9a07d900f2d30c4f8fe56605efae3e6f40396655045f757c3efebb9d8 |
| hovercard-subject-tag | issue:6214401867 |
| 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/NativeScript/NativeScript/11615/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa8afe700212df03d800debf77c5ed38831b0993d57c5ce428407e44dad429c7/NativeScript/NativeScript/issues/11615 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa8afe700212df03d800debf77c5ed38831b0993d57c5ce428407e44dad429c7/NativeScript/NativeScript/issues/11615 |
| og:image:alt | Issue Description Runtime bug on Android. An app that uses one root view across activities can show a blank screen when it is reopened. Android can start a new activity before the old one stops. Th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | herefishyfish |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width