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;
}
@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
public void onAllDeleted() {

View File

@ -294,7 +294,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
@Override
public void onDestroy() {
binding = null;
unregisterReceiver(onDownloadComplete);
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
public boolean onOptionsItemSelected(MenuItem item) {

View File

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

View File

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