diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index 2dc7fe4b10..59b5aaaa4c 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -351,12 +351,13 @@ public class FileDetailFragment extends FileFragment implements OnClickListener, } }); - // FIXME file detail not opening from Media tab - if (binding != null) { - TabLayout.Tab tab = binding.tabLayout.getTabAt(activeTab); - if (tab == null) return; - binding.tabLayout.selectTab(tab); - } + binding.tabLayout.post(() -> { + if (binding != null) { + TabLayout.Tab tab = binding.tabLayout.getTabAt(activeTab); + if (tab == null) return; + tab.select(); + } + }); } @Override diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.kt b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.kt index ff6d81ded9..9ed0babe6a 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.kt @@ -357,7 +357,7 @@ class PreviewImageActivity : FileActivity(), FileFragment.ContainerActivity, OnR } startActivity(intent) - backToDisplayActivity() + finish() } override fun showDetails(file: OCFile, activeTab: Int) {