From 0de198a0fa4e114220da29f7bb60dbf7cf2c47b6 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 29 Sep 2021 10:14:01 +0200 Subject: [PATCH] Revert "Clear delayed" This reverts commit 4f2b0995bf17607656ab7d36b1de82c0c3fe44c2. --- .../java/eu/faircode/email/ActivityBase.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 5ff90483f5..7e127ce99d 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -766,24 +766,19 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment f) { log(fm, f, "onFragmentDestroyed"); - getMainHandler().post(new Runnable() { - @Override - public void run() { - try { - for (Field field : f.getClass().getDeclaredFields()) { - Class type = field.getType(); - if (View.class.isAssignableFrom(type) || - RecyclerView.Adapter.class.isAssignableFrom(type)) { - Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName()); - field.setAccessible(true); - field.set(f, null); - } - } - } catch (Throwable ex) { - Log.w(ex); + try { + for (Field field : f.getClass().getDeclaredFields()) { + Class type = field.getType(); + if (View.class.isAssignableFrom(type) || + RecyclerView.Adapter.class.isAssignableFrom(type)) { + Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName()); + field.setAccessible(true); + field.set(f, null); } } - }); + } catch (Throwable ex) { + Log.w(ex); + } } @Override