mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-04 03:43:55 +01:00
Prevent multiple loads
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user