Some fixes

This commit is contained in:
Thomas 2022-07-10 17:46:14 +02:00
parent 425d19f2d6
commit eb1be4f514
6 changed files with 3 additions and 26 deletions

View file

@ -168,10 +168,4 @@ public class ContextActivity extends BaseActivity {
return true; return true;
} }
@Override
protected void onDestroy() {
super.onDestroy();
binding = null;
currentFragment = null;
}
} }

View file

@ -205,12 +205,6 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr
} }
} }
@Override
public void onDestroy() {
super.onDestroy();
binding.lvStatus.setAdapter(null);
binding = null;
}
@Override @Override
public void onAllDeleted() { public void onAllDeleted() {

View file

@ -294,7 +294,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
@Override @Override
public void onDestroy() { public void onDestroy() {
binding = null;
unregisterReceiver(onDownloadComplete); unregisterReceiver(onDownloadComplete);
super.onDestroy(); super.onDestroy();
} }

View file

@ -156,15 +156,6 @@ public class SettingsActivity extends BaseActivity {
} }
@Override
protected void onDestroy() {
super.onDestroy();
if (currentFragment != null) {
currentFragment.onDestroy();
}
binding = null;
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {

View file

@ -122,7 +122,7 @@ public class FragmentMedia extends Fragment {
binding.mediaPicture.setVisibility(View.VISIBLE); binding.mediaPicture.setVisibility(View.VISIBLE);
binding.mediaPicture.setTransitionName(attachment.url); binding.mediaPicture.setTransitionName(attachment.url);
if (Helper.isValidContextForGlide(requireActivity())) { if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
Glide.with(requireActivity()) Glide.with(requireActivity())
.asBitmap() .asBitmap()
.dontTransform() .dontTransform()
@ -142,7 +142,7 @@ public class FragmentMedia extends Fragment {
binding.mediaPicture.setVisibility(View.VISIBLE); binding.mediaPicture.setVisibility(View.VISIBLE);
binding.pbarInf.setIndeterminate(true); binding.pbarInf.setIndeterminate(true);
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);
if (Helper.isValidContextForGlide(requireActivity())) { if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
Glide.with(requireActivity()) Glide.with(requireActivity())
.asBitmap() .asBitmap()
.dontTransform() .dontTransform()
@ -312,7 +312,6 @@ public class FragmentMedia extends Fragment {
timer.cancel(); timer.cancel();
timer = null; timer = null;
} }
binding = null;
} }
@Override @Override

View file

@ -494,8 +494,8 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
} }
}).start(); }).start();
} }
super.onDestroyView();
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action); LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action);
super.onDestroyView();
} }
@Override @Override