Code Monkey home page Code Monkey logo

Comments (3)

dlluotian avatar dlluotian commented on May 27, 2024 1

这个有个小小的建议,希望SDK只能加个参数,自己处理异常,比如结束当前进程并重启,而不是直接结束程序。 现在要满足重启的需要,只能修改源码

直接结束,是因为你把rethrow 设置为false导致的。

感觉您的回复,只是如果不修改源码,只是将rethrow设置true,可以实现重启,但是效果并不好的,我测试设备小米11,这样会白屏一段时间,并且有几率无法重启,原因不明。

修改成如下,就会非常丝滑

    if (this.rethrow) {
        if (defaultHandler != null) {
            defaultHandler.uncaughtException(thread, throwable);
        }
    } else {
        //这里我们自己做重启逻辑
    try {
        Thread.sleep(500);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    ProcessPhoenix.triggerRebirth(getContext());
    }

from xcrash.

superoidlau avatar superoidlau commented on May 27, 2024

rethrow 这个设置为true,然后你可以自己再次拿到这个异常去处理。

from xcrash.

superoidlau avatar superoidlau commented on May 27, 2024

这个有个小小的建议,希望SDK只能加个参数,自己处理异常,比如结束当前进程并重启,而不是直接结束程序。 现在要满足重启的需要,只能修改源码

直接结束,是因为你把rethrow 设置为false导致的。

from xcrash.

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.