File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/main/java/com/owncloud/android/ui/fragment Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -748,12 +748,14 @@ open class ExtendedListFragment :
748
748
}
749
749
750
750
protected fun setupBackButtonRedirectToAllFiles () {
751
+ val fda = getTypedActivity(FileActivity ::class .java)
752
+ val currentDir = fda?.currentDir ? : return
753
+
751
754
view?.isFocusableInTouchMode = true
752
755
view?.requestFocus()
753
756
view?.setOnKeyListener { _: View , keyCode: Int , event: KeyEvent ->
754
- val fda = getTypedActivity(FileActivity ::class .java)
755
- if (fda != null && (event.action == KeyEvent .ACTION_UP && keyCode == KeyEvent .KEYCODE_BACK )) {
756
- return @setOnKeyListener fda.handleBackButtonEvent(fda.currentDir)
757
+ if (event.action == KeyEvent .ACTION_UP && keyCode == KeyEvent .KEYCODE_BACK ) {
758
+ return @setOnKeyListener fda.handleBackButtonEvent(currentDir)
757
759
}
758
760
false
759
761
}
You can’t perform that action at this time.
0 commit comments