Skip to content

Commit

Permalink
Fix: Crash when context is not available in change listener
Browse files Browse the repository at this point in the history
Ref: IllegalStateException @ FileExplorerFragment:237
  • Loading branch information
x0b committed Apr 18, 2021
1 parent 870088e commit 86df0ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
showThumbnails = sharedPreferences.getBoolean(getString(R.string.pref_key_show_thumbnails), false);
isDarkTheme = sharedPreferences.getBoolean(getString(R.string.pref_key_dark_theme), false);
goToDefaultSet = sharedPreferences.getBoolean(getString(R.string.pref_key_go_to_default_set), false);
String wrapFilenamesKey = getString(R.string.pref_key_wrap_filenames);
prefChangeListener = (pref, key) -> {
String wrapFilenamesKey = getString(R.string.pref_key_wrap_filenames);
if (key.equals(wrapFilenamesKey) && recyclerViewAdapter != null) {
recyclerViewAdapter.setWrapFileNames(pref.getBoolean(wrapFilenamesKey, true));
}
Expand Down

0 comments on commit 86df0ca

Please sign in to comment.