Coder Social home page Coder Social logo

有些手机闪退 about shareloginlib HOT 5 OPEN

kaleai avatar kaleai commented on June 11, 2024
有些手机闪退

from shareloginlib.

Comments (5)

kaleai avatar kaleai commented on June 11, 2024

发现是一个变量为null了,变量为:onCreateListener。

shareloginlib.destroy()的时候会置空,而开始请求登录、分享时候会给这个变量赋值。EventHandlerActivity被finish的时候,就会置空这个变量。

如果此问题是毕现的,那么可以看下当前的activity栈,是不是EventHandlerActivity这个栈有问题。

如果经常会出现这个情况,我会尝试将其做成软引用来减少此问题。

from shareloginlib.

LaoHuan avatar LaoHuan commented on June 11, 2024

很多都会出现这个问题。

from shareloginlib.

kaleai avatar kaleai commented on June 11, 2024

@LaoHuan 根据我上面提到的中间的这层activity被Destroy的时候会进行变量的置空。所以你可以看下activity栈的情况,根据上面的详细解释逐一定位问题。

from shareloginlib.

renhuan avatar renhuan commented on June 11, 2024

@LaoHuan 根据我上面提到的中间的这层activity被Destroy的时候会进行变量的置空。所以你可以看下activity栈的情况,根据上面的详细解释逐一定位问题。

分享成功之后,先不返回,打开最近任务键,回到应用,必会出现此问题

from shareloginlib.

renhuan avatar renhuan commented on June 11, 2024

这种情况会导致 EventHandlerActivity 未finish,解决方法在Application中注册addOnAppStatusChangedListener,监听前后台切换,手动关闭即可

override fun onForeground(activity: Activity?) {
    if (activity is EventHandlerActivity) {
        ActivityUtils.finishActivity(activity)
    }
}

from shareloginlib.

Related Issues (18)

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.