Merge pull request #10217 from nextcloud/fix/on-device-crash

Fix crash when navigating from Gallery to On device
This commit is contained in:
Álvaro Brey 2022-05-09 15:03:34 +02:00 committed by GitHub
commit e7ea566bb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -2282,8 +2282,10 @@ public class FileDisplayActivity extends FileActivity
updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_item_on_device));
}
OCFileListFragment ocFileListFragment = getListOfFilesFragment();
if (ocFileListFragment != null) {
if (ocFileListFragment != null && !(ocFileListFragment instanceof GalleryFragment) && !(ocFileListFragment instanceof SharedListFragment)) {
ocFileListFragment.refreshDirectory();
} else {
setLeftFragment(new OCFileListFragment());
}
}

View file

@ -410,7 +410,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) fragmentActivity;
fileDisplayActivity.updateActionBarTitleAndHomeButton(fileDisplayActivity.getCurrentDir());
}
listDirectory(false, false);
listDirectory(MainApp.isOnlyOnDevice(), false);
}
protected void setAdapter(Bundle args) {