Handle all unexpected errors

This commit is contained in:
M66B
2018-12-11 11:31:31 +01:00
parent 3f93a999fa
commit f14de224aa
5 changed files with 28 additions and 7 deletions

View File

@@ -162,16 +162,12 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
}
}
protected T onLoad(Context context, Bundle args) throws Throwable {
// Be careful not to access members in outer scopes
return null;
}
protected abstract T onLoad(Context context, Bundle args) throws Throwable;
protected void onLoaded(Bundle args, T data) {
}
protected void onException(Bundle args, Throwable ex) {
}
protected abstract void onException(Bundle args, Throwable ex);
private static class Result {
Throwable ex;