Prevent crash

This commit is contained in:
M66B
2022-06-24 22:53:26 +02:00
parent fe6686dda2
commit abeae50ccc
9 changed files with 24 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
@@ -632,6 +633,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());