diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 47b26bb480..ac4125f9af 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1629,7 +1629,7 @@ public class FragmentCompose extends FragmentEx { EntityOperation.queue(db, draft, EntityOperation.DELETE); if (!empty) { - Handler handler = new Handler(Looper.getMainLooper()); + Handler handler = new Handler(context.getMainLooper()); handler.post(new Runnable() { public void run() { Toast.makeText(context, R.string.title_draft_deleted, Toast.LENGTH_LONG).show(); @@ -1639,7 +1639,7 @@ public class FragmentCompose extends FragmentEx { } else if (action == R.id.action_save || action == R.id.menu_encrypt) { EntityOperation.queue(db, draft, EntityOperation.ADD); - Handler handler = new Handler(Looper.getMainLooper()); + Handler handler = new Handler(context.getMainLooper()); handler.post(new Runnable() { public void run() { Toast.makeText(context, R.string.title_draft_saved, Toast.LENGTH_LONG).show(); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 8cc8b8e057..e3c2926880 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -2564,7 +2564,7 @@ public class ServiceSynchronize extends LifecycleService { if (outbox != null) { db.folder().setFolderError(outbox.id, null); - handler = new Handler(Looper.getMainLooper()) { + handler = new Handler(getMainLooper()) { private LiveData> liveOperations; @Override