简体   繁体   中英

Can I call and execute a method when app is crashing by OS or any other exceptions?

I'm having an app which starts BLE session and do its job. But when the app crashed I want to stop the BLE session and stop other BLE services running. Can somebody help me to achieve this?

I tried services and I was able to stop them successfully. But the objects and BLE sessions are defined in few classes are not able to.

This code snippet can be modified to execute a method when an uncaught exception is thrown depending on the thread that your exception occurs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM