mirror of https://github.com/M66B/FairEmail.git
Prevent crash
This commit is contained in:
parent
3b1ff558db
commit
625bb0dfa8
|
@ -785,6 +785,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
swExternalStorage.setEnabled(getContext().getExternalFilesDir(null) != null);
|
||||||
swExternalStorage.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swExternalStorage.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
@ -1311,8 +1312,9 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
setLastCleanup(prefs.getLong("last_cleanup", -1));
|
setLastCleanup(prefs.getLong("last_cleanup", -1));
|
||||||
|
|
||||||
File external = getContext().getExternalFilesDir(null);
|
File external = getContext().getExternalFilesDir(null);
|
||||||
boolean emulated = Environment.isExternalStorageEmulated(external);
|
boolean emulated = (external != null && Environment.isExternalStorageEmulated(external));
|
||||||
tvExternalStorageFolder.setText(external.getAbsolutePath() + (emulated ? " emulated" : ""));
|
tvExternalStorageFolder.setText(
|
||||||
|
(external == null ? null : external.getAbsolutePath()) + (emulated ? " emulated" : ""));
|
||||||
|
|
||||||
swExactAlarms.setEnabled(AlarmManagerCompatEx.canScheduleExactAlarms(getContext()));
|
swExactAlarms.setEnabled(AlarmManagerCompatEx.canScheduleExactAlarms(getContext()));
|
||||||
swTestIab.setVisibility(BuildConfig.TEST_RELEASE ? View.VISIBLE : View.GONE);
|
swTestIab.setVisibility(BuildConfig.TEST_RELEASE ? View.VISIBLE : View.GONE);
|
||||||
|
|
Loading…
Reference in New Issue