File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
app/src/main/java/com/owncloud/android/ui/activity Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -564,10 +564,17 @@ class FileDisplayActivity :
564564 ALL_FILES == action -> {
565565 Log_OC .d(this , " Switch to oc file fragment" )
566566 menuItemId = R .id.nav_all_files
567- if (leftFragment !is OCFileListFragment ) {
568- leftFragment = OCFileListFragment ()
569- supportFragmentManager.executePendingTransactions()
567+
568+ // Replace only if the fragment is NOT exactly OCFileListFragment
569+ // Using `is OCFileListFragment` would also match subclasses,
570+ // its needed because reinitializing OCFileListFragment itself causes an empty screen
571+ leftFragment?.let {
572+ if (it::class != OCFileListFragment ::class ) {
573+ leftFragment = OCFileListFragment ()
574+ supportFragmentManager.executePendingTransactions()
575+ }
570576 }
577+
571578 browseToRoot()
572579 }
573580
You can’t perform that action at this time.
0 commit comments