Giter VIP home page Giter VIP logo

Comments (3)

baoyongzhang avatar baoyongzhang commented on August 23, 2024 6

当Activity不在前台的时候,系统可能会回收的时候会调用onSaveInstanceState,这时候再show就会出现这个异常。将show方法里面的commit改为commitAllowingStateLoss应该可以解决。

from android-actionsheet.

XingmingLi avatar XingmingLi commented on August 23, 2024 5

@HolenZhou
用Handler延迟执行一个继承自DialogFragment的对话框的显示。显示前按home,就可以出现这个错。
我的解决办法(针对对话框):
`override fun show(manager: FragmentManager?, tag: String?) {
if (manager == null)
return

    if (Integer.valueOf(android.os.Build.VERSION.SDK) > Build.VERSION_CODES.JELLY_BEAN) {
        if (manager.isDestroyed)
            return
    }

    try {
        super.show(manager, tag)
    } catch (e: Exception) {
        e.printStackTrace()
    }
}`

from android-actionsheet.

HolenZhou avatar HolenZhou commented on August 23, 2024

我试了将commit改为commitAllowingStateLoss,也查过原因应该是当前Activity被回收造成的,但是我无法复现这个crash,不知是不是有什么方法可以复现这个crash呢?因为有其他地方有类似的crash,如果可以复现,我就可以测试是否真正解决,我自己通过更改手机字体大小来模拟内存回收,但也没演示出bug,请大牛指点,非常感谢!

from android-actionsheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.