NativeScript / NativeScript/NativeScript

New Webview added to view stack when coming from background

未关闭
#4,981 15 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

backlog os: android
主要语言
TypeScript
星标
25.7k
派生
1.7k
平均合并
1 天 5 小时
30 天内合并 PR
35

描述

I've wrote a small app that has a webview to illustrate the issue: https://github.com/surdu/TestBkg

In the onload method of that webview I have implemented a quick mechanism to change the webview's src only the first time the onload method is called, just to illustrate better the problem.

To reproduce the problem we follow these steps:

  1. launch the app on Android using tns run android. We notice the app load NS' website.
  2. put the app in background by pressing the home button
  3. bring back the app by pressing the app icon on the phone

On the last step is where the problem is: a new blank webview is added on top of the old one (if we press the back button on the phone, the old webview will be revealed).

Now let's consider a second scenario. After completing the above scenario, we kill the app by pressing the Overview button and close our app from there (by swipe or by pressing the X button).

Now, if we replace the step 1 by just opening the app from the phone (NOT by running tns run android) and then go through the same steps, we'll notice that at step 3 the behaviour changes: now we will be correctly presented with the old webview.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 app/main-page.js 中链接的复现应用开始,按照后台运行和重新打开应用的步骤,使用 tns run android 复现生命周期。跟踪应用从后台返回时 Android webview 的行为;完成标准是重新打开应用不会在现有 webview 上方添加空白 webview。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, javascript, typescript
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。