GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Android] Blank screen when a new activity adopts a shared root view before the old one stops · Issue #11615 · NativeScript/NativeScript

[Android] Blank screen when a new activity adopts a shared root view before the old one stops #11615

New issue
Copy link
New issue
Copy link
Open
#11624
Open
[Android] Blank screen when a new activity adopts a shared root view before the old one stops#11615
#11624
Copy link

Description

@herefishyfish
herefishyfish
opened on Nov 5, 2026
Issue body actions

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 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.

An 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.

Expected behavior: the reopened app shows its page.

Related case with the same cause:

  • Returning to an older activity after a newer one took the root view also shows a blank screen.

Apps 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.

I 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.

Related:

  • [Android] After exiting with Back, reopening the app in the same process never fires launch again (9.1 regression, Angular apps stay dead and unstyled) #11572 and fix(core): fire launch again for the first window after exit #11573 cover a reopen after exit, which is a different case from this one.
  • fix(android): stop the FragmentManager driving fragments with a dead entry #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 fix(android): stop the FragmentManager driving fragments with a dead entry #11352 against it.
  • Android: Frame navigation stalls after activity.recreate() #11591 also affects recreated activities, but it has a different cause.

Reproduction

Use apps/toolbox from this repository and replace src/main.ts:

import { Application, Frame } from '@nativescript/core';

let root: Frame;

Application.run({
  create() {
    if (!root) {
      root = new Frame();
      root.navigate({ moduleName: 'main-page' });
    }
    return root;
  },
});
  1. Run the app with ns run android.

  2. Wait for the main page to appear.

  3. Start a second activity:

    adb shell am start -f 0x08000000 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.nativescript.ToolBox/com.tns.NativeScriptActivity
  4. The screen stays blank.

The same blank screen appears with Back and an immediate reopen. On the main page, run:

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"

Each 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.

Waiting 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.

Relevant log output (if applicable)

Android event log for Back with an immediate reopen. The new activity starts before the old one stops:

wm_on_create_called:  [199554052, com.tns.NativeScriptActivity]
wm_on_start_called:   [199554052, com.tns.NativeScriptActivity]
wm_on_stop_called:    [260012955, com.tns.NativeScriptActivity]
wm_on_destroy_called: [260012955, com.tns.NativeScriptActivity]

Environment

  • @nativescript/core: built from main at 07e84ec58 (9.1.4-next.4)
  • @nativescript/android: 9.1.1
  • Device: Android emulator, API 36, x86_64
  • OS: Windows 11
Reacted by Dylan Llewellyn

Activity

  1. herefishyfish
    added a commit that references this issue on Nov 10, 2026

    fix(android): keep the root view when an activity replaces another

    This issue will close once commit 129b25a is merged into the 'master' branch.
    129b25a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.