Recover exit on BACK pressed
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileDisplayActivity.java
index effe3b8..2b07fa4 100644 (file)
@@ -195,6 +195,9 @@ public class FileDisplayActivity extends HookActivity
         getSupportActionBar().setHomeButtonEnabled(true);       // mandatory since Android ICS,
                                                                 // according to the official
                                                                 // documentation
+        if (getFile() != null) {
+            updateActionBarTitle();
+        }
 
         setSupportProgressBarIndeterminateVisibility(mSyncInProgress
         /*|| mRefreshSharesInProgress*/);
@@ -733,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();
             }
@@ -770,6 +777,7 @@ public class FileDisplayActivity extends HookActivity
         // refresh Navigation Drawer account list
         mNavigationDrawerAdapter.updateAccountList();
 
+
         // refresh list of files
         refreshListOfFilesFragment();