New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好 问下某种异常情况下,暂不好复现,返回键 或者调用popupbackStack() 无反应 #228

Closed
hewking opened this Issue Apr 9, 2018 · 10 comments

Comments

Projects
None yet
3 participants
@hewking

hewking commented Apr 9, 2018

运行环境

  • 设备型号:如:Nexus 6
  • 设备系统版本:如 Android 5.0
  • Gradle 版本:如 2.3.0
  • QMUI Android 版本:1.x.x

具体问题描述

现象如题, 通过debug 发现,代码是往下执行了,通过调用
(QMUIFragment) getSupportFragmentManager().findFragmentById(getContextViewId());
获取当前 fragment 发现是上一个Fragment 的值,而不是当前fragment ,导致无法返回,退出,请问是什么原因

问题截图

异常日志(堆栈)

@cgspine

This comment has been minimized.

Member

cgspine commented Apr 10, 2018

startFragment 是用的 replace 吗?还有想问下,你的 support 包版本是多少?

@hewking

This comment has been minimized.

hewking commented Apr 10, 2018

我用v4 包是 27.1.0 的 , 用的 startFragment 是qmui 默认的 replace ,就这个问题很奇怪,很难复现,退出到首页在进入,可能会出现

@cgspine

This comment has been minimized.

Member

cgspine commented Apr 11, 2018

https://issuetracker.google.com/issues/74051124
27.1.0 对于 replace 好像存在bug,不过我不确定是不是引发这个问题的原因。可以升级 support 到 27.1.1 试试会不会重现

@hewking

This comment has been minimized.

hewking commented Apr 11, 2018

嗯 多谢 那我试试看,另外为啥这个https://issuetracker.google.com/issues/74051124 为啥我打不开 挂代理也不行 有点懵

@hewking

This comment has been minimized.

hewking commented Apr 11, 2018

链接可以打开了, 想问一下,你用的v4包是那个版本的? 还有 addToBackStack() 在startFragment 的时候,某些Fragment 没有调用,因为需要实现返回 上上 一个页面不需要保留上一个Fragment,类似直接finish 的操作一样的效果。所以某些Fragment没有调用addToBackStackt() 会不会这中操作会导致异常

@cgspine

This comment has been minimized.

Member

cgspine commented Apr 11, 2018

现在我用的是27.0.1。 也有这个可能,我晚点追踪下,看看能不能找到线索。主要是目前我没有复现过

@hewking

This comment has been minimized.

hewking commented Apr 12, 2018

这个bug 是很难复现,出现了,去查找,水平有限没有解决,谢谢了啊

@cgspine

This comment has been minimized.

Member

cgspine commented Apr 21, 2018

addToBackStack 确实存在问题, 请升级到0.1.0,使用 startFragmentAndDestroyCurrent。
详细分析可以看博文:http://blog.cgsdream.org/2018/04/21/backstack_in_fragment_manager/

@hewking

This comment has been minimized.

hewking commented Apr 26, 2018

最近也忙 ,刚看到。还在受到fragment bug困扰。像个幽灵一样好苦逼,那刚看完博客,很棒,我先试试。我在开发过程中还遇到一个问题,有时会出现重影的情况,这个我也解决不了,很难复现。有没有遇到过这种情况?

@cgspine

This comment has been minimized.

Member

cgspine commented Apr 28, 2018

重影应该是27.1.0的bug吧,你有升级吗?(虽然我没遇到过)

@MoLice MoLice closed this Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment