Explorar el Código

Recover exit on BACK pressed

David A. Velasco hace 10 años
padre
commit
bf23f0b5e9
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      src/com/owncloud/android/ui/activity/FileDisplayActivity.java

+ 4 - 0
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -736,6 +736,10 @@ public class FileDisplayActivity extends HookActivity
     public void onBackPressed() {
         OCFileListFragment listOfFiles = getListOfFilesFragment(); 
         if (mDualPane || getSecondFragment() == null) {
+            if (getFile() != null && getFile().getParentId() == 0) {
+                finish();
+                return;
+            }
             if (listOfFiles != null) {  // should never be null, indeed
                 listOfFiles.onBrowseUp();
             }