2015-04-27 75 views
0

我處理未捕獲的異常在Android作爲跟隨處理「未捕獲的異常」仍然崩潰的應用程序

Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { 
    @Override 
    public void uncaughtException(Thread thread, Throwable e) { 
     handleUncaughtException(thread, e); 
    } 
}) 

public void handleUncaughtException(Thread thread, Throwable e) { 
    Helper.logUncaughtExceptionToFile(e); // Just to log the exception 
} 

它正常工作對我來說,它處理異常,但是當異常發生得到了打電話給我的函數,則應用程序崩潰。這是應該如何工作?我不希望應用程序崩潰

+0

請張貼您的logcat崩潰。 – prakash

+0

我的logcat –

回答

1

只處理與線程相關的異常。如果特定線程具有將數據提取到UI的工作,那麼應用程序會崩潰而不具有生成UI所需的值。

+0

中沒有例外,如果您點擊向上按鈕,這將有所幫助。 –

相關問題