Browse Source

Prevent multiple loads

main
M66B 6 years ago
parent
commit
7cb37c33b9
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      app/src/main/java/eu/faircode/email/SimpleLoader.java

+ 4
- 1
app/src/main/java/eu/faircode/email/SimpleLoader.java View File

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


Loading…
Cancel
Save