Title: [Android] App with no main entry shows a blank screen when reopened right after Back · Issue #11631 · NativeScript/NativeScript · GitHub
Open Graph Title: [Android] App with no main entry shows a blank screen when reopened right after Back · Issue #11631 · NativeScript/NativeScript
X Title: [Android] App with no main entry shows a blank screen when reopened right after Back · Issue #11631 · NativeScript/NativeScript
Description: Issue Description Runtime bug on Android. An app that supplies its root view from the launch event, with no main entry, shows a blank screen when it is reopened right after the user leaves with Back. Android starts the new activity befor...
Open Graph Description: Issue Description Runtime bug on Android. An app that supplies its root view from the launch event, with no main entry, shows a blank screen when it is reopened right after the user leaves with Bac...
X Description: Issue Description Runtime bug on Android. An app that supplies its root view from the launch event, with no main entry, shows a blank screen when it is reopened right after the user leaves with Bac...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/11631
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Android] App with no main entry shows a blank screen when reopened right after Back","articleBody":"### Issue Description\n\nRuntime bug on Android. An app that supplies its root view from the `launch` event, with no main entry, shows a blank screen when it is reopened right after the user leaves with Back.\n\nAndroid starts the new activity before the old one is destroyed. `exit` has not fired yet, so `launch` does not fire for the new activity. With no main entry and no `launch`, nothing supplies a root view, and the new activity stays empty.\n\nThis is the shape Angular apps use by default, so it may explain blank screens I have seen in Angular apps. I have not confirmed that in a real Angular app.\n\nExpected behavior: the reopened app shows its page.\n\nRelated:\n\n- #11615 and #11624 cover the same timing for apps that reuse one root view. #11624 does not fix this case.\n- #11572 and #11573 cover a reopen after `exit` has fired. This case happens before `exit`.\n- Pressing Back on a window with no root view crashes with `TypeError: Cannot read properties of undefined (reading 'notify')` in `onBackPressed`. I reproduced that crash on a second activity started with `-f 0x08000000`.\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\nApplication.on(Application.launchEvent, (args: any) => {\n const root = new Frame();\n root.navigate({ moduleName: 'main-page' });\n args.root = root;\n});\n\nApplication.run();\n```\n\n1. Build the app with `ns build android`, install it, and wait for the main page.\n2. Press Back and reopen at once:\n\n ```shell\n adb 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\n3. The screen stays blank.\n\nThis gave a blank screen in 5 of 5 trials. The app stayed in focus and did not crash.\n\n### Relevant log output (if applicable)\n\nAndroid event log for one trial. The new activity is created and started before the old one stops:\n\n```shell\nwm_on_create_called: [77903689, com.tns.NativeScriptActivity]\nwm_on_start_called: [77903689, com.tns.NativeScriptActivity]\nwm_on_stop_called: [253142999, com.tns.NativeScriptActivity]\nwm_on_destroy_called: [253142999, 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-10T03:57:44Z","url":"https://github.com/NativeScript/NativeScript/issues/11631"}
| 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:4e8e1a1e-3e61-5fb7-e586-c8a7ff640d51 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CBA2:A20F9:1613990:1D422DC:6B012FD9 |
| html-safe-nonce | b9e6c9ddb496085f0df3d6dd706480bfd37c33a845c51a3f9b1df51d21ffbcc2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkEyOkEyMEY5OjE2MTM5OTA6MUQ0MjJEQzo2QjAxMkZEOSIsInZpc2l0b3JfaWQiOiI1MDkyOTE0MDIwMjkwMjExODAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 781b4320808b6038b50b5a3a29ff046a8572cc4610b2a27c3384a2e3bc30b150 |
| hovercard-subject-tag | issue:6299955091 |
| 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/11631/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce5d1497a96b3ecd11c317f628cceb6b1002cfebba6264bc4b4126a4c4e65350/NativeScript/NativeScript/issues/11631 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce5d1497a96b3ecd11c317f628cceb6b1002cfebba6264bc4b4126a4c4e65350/NativeScript/NativeScript/issues/11631 |
| og:image:alt | Issue Description Runtime bug on Android. An app that supplies its root view from the launch event, with no main entry, shows a blank screen when it is reopened right after the user leaves with Bac... |
| 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