Prevent crash

This commit is contained in:
M66B
2019-09-10 08:53:07 +02:00
parent 2318389a03
commit 3369ef9431
7 changed files with 23 additions and 9 deletions

View File

@@ -39,6 +39,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.preference.PreferenceManager;
public class FragmentOptionsDisplay extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
@@ -333,7 +334,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
setOptions();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
setOptions();
}
@Override