1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Revert "Clear delayed"

This reverts commit 4f2b0995bf.
This commit is contained in:
M66B 2021-09-29 10:14:01 +02:00
parent eb733656a3
commit 0de198a0fa

View file

@ -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