mirror of https://github.com/M66B/FairEmail.git
Use local looper
This commit is contained in:
parent
d5b59bee51
commit
80c5969f82
|
@ -116,8 +116,11 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
this.paused = false;
|
||||
this.args = null;
|
||||
this.stored = null;
|
||||
|
||||
owner.getLifecycle().addObserver(this);
|
||||
|
||||
final Handler handler = new Handler();
|
||||
|
||||
// Run in background thread
|
||||
executor.submit(new Runnable() {
|
||||
@Override
|
||||
|
@ -132,7 +135,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
}
|
||||
|
||||
// Run on main thread
|
||||
new Handler(context.getMainLooper()).post(new Runnable() {
|
||||
handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
deliver(args, result);
|
||||
|
|
Loading…
Reference in New Issue