Can I call a method before my application go to crash

前端 未结 5 1276
庸人自扰
庸人自扰 2020-12-30 16:26

I\'m a newbie in android and I always see Exception when I\'m running my code. So, somebody can tell me Can I call a method before app go to crash anywhere without \"try-cat

5条回答
  •  萌比男神i
    2020-12-30 16:52

    I think what you search is the UncaughtExceptionHandler. It is notified whenever an Exception is fired and not catched on its way bubbling up through your application.

    See http://www.intertech.com/Blog/android-handling-the-unexpected/ for more details on implementing this in android.

提交回复
热议问题