fix(android): finish activity at native root back

Agent-Logs-Url: https://github.com/logseq/logseq/sessions/8607ea41-e86e-4901-bc85-cb886e184f1d

Co-authored-by: xyhp915 <1779837+xyhp915@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-21 05:38:54 +00:00
committed by GitHub
parent 201305ceeb
commit 3a21c8bc7f

View File

@@ -228,15 +228,17 @@ public class MainActivity extends BridgeActivity {
WebView webView = getBridge().getWebView();
if (webView != null) {
NavigationRenderState nativePopState = navigationCoordinator.prepareNativePop();
if (nativePopState != null) {
Log.d(
"NavStack",
NAV_STACK_DEBUG_PREFIX + " activity.nativeBack consumed=native-stack-pop target="
+ nativePopState.getPath()
+ " paths=" + nativePopState.getPaths()
);
ComposeHost.applyNavigation(nativePopState);
if (nativePopState == null) {
finish();
return;
}
Log.d(
"NavStack",
NAV_STACK_DEBUG_PREFIX + " activity.nativeBack consumed=native-stack-pop target="
+ nativePopState.getPath()
+ " paths=" + nativePopState.getPaths()
);
ComposeHost.applyNavigation(nativePopState);
// Send "native back" into JS. JS will call your UILocal/route-change,
// which flows into ComposeHost.applyNavigation(...) and animates.
sendJsBack(webView);