Prevent crash

pull/208/head
M66B 3 years ago
parent fe6686dda2
commit abeae50ccc

@ -50,6 +50,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
@ -532,6 +533,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -392,6 +392,8 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -52,6 +52,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
import com.flask.colorpicker.ColorPickerView;
@ -1314,6 +1315,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -598,6 +598,8 @@ public class FragmentOptionsEncryption extends FragmentBase
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -70,6 +70,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
@ -1663,6 +1664,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -52,6 +52,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
import java.util.List;
@ -661,6 +662,8 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
boolean pro = ActivityBilling.isPro(getContext());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -531,6 +531,8 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

@ -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());

@ -47,6 +47,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -556,6 +557,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private void setOptions() {
if (getContext() == null)
return;
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean pro = ActivityBilling.isPro(getContext());

Loading…
Cancel
Save