CodePudding user response:
The coding problem fault tolerance, there is something wrong with the child thread running your exit thread break, or return, and then send a Message to tell the main thread have error, generally will not affect the main thread,CodePudding user response:
Catch mistakes and then correct it, such as the upstairs said in the Message tells the main thread,CodePudding user response:
Across threads catch exceptions not capturedThread. SetDefaultUncaughtExceptionHandler (new Thread. UncaughtExceptionHandler () {
@ Override
Public void uncaughtException (Thread t, Throwable e) {
//
}
});