The method:
private void initUncaughtExceptionHandler() {
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
Log.e("UncaughtException!", ex.getMessage());
Log.e("UncaughtException!", Log.getStackTraceString(ex));
}
});
}
Invocation of the method:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initUncaughtExceptionHandler();
setContentView(R.layout.main);
[...]
}
No comments:
Post a Comment