|
|
@ -66,6 +66,7 @@ public abstract class SimpleLoader<T> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static class CommonLoader extends AsyncTaskLoader<Result> {
|
|
|
|
private static class CommonLoader extends AsyncTaskLoader<Result> {
|
|
|
|
|
|
|
|
boolean loading = false;
|
|
|
|
Bundle args;
|
|
|
|
Bundle args;
|
|
|
|
SimpleLoader loader;
|
|
|
|
SimpleLoader loader;
|
|
|
|
|
|
|
|
|
|
|
@ -79,11 +80,13 @@ public abstract class SimpleLoader<T> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void onStartLoading() {
|
|
|
|
protected void onStartLoading() {
|
|
|
|
forceLoad();
|
|
|
|
if (!loading)
|
|
|
|
|
|
|
|
forceLoad();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Result loadInBackground() {
|
|
|
|
public Result loadInBackground() {
|
|
|
|
|
|
|
|
loading = true;
|
|
|
|
Result result = new Result();
|
|
|
|
Result result = new Result();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
result.data = loader.onLoad(args);
|
|
|
|
result.data = loader.onLoad(args);
|
|
|
|