Skip to content

Commit

Permalink
use onStart for provide same behaviour when app is on background and …
Browse files Browse the repository at this point in the history
…on foreground

Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Aug 2, 2024
1 parent 73cad93 commit 7b0a75b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable {

toggleDrawerLockMode(containerActivity, DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
addMenuHost()
prepareMedia()
}

private fun checkArgumentsAfterViewCreation(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -276,6 +275,11 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable {
}
}

override fun onStart() {
super.onStart()
prepareMedia()
}

private fun prepareMedia() {
if (file == null || !isAdded) {
Log_OC.d(TAG, "File is null or fragment not attached to a context.")
Expand Down

0 comments on commit 7b0a75b

Please sign in to comment.