+ /**
+ * Called when the ownCloud {@link Account} associated to the Activity was
+ * just updated.
+ */
+ @Override
+ protected void onAccountSet(boolean stateWasRecovered) {
+ super.onAccountSet(stateWasRecovered);
+ if (getAccount() != null) {
+
+ updateFileFromDB();
+
+ OCFile folder = getFile();
+ if (folder == null || !folder.isFolder()) {
+ // fall back to root folder
+ setFile(getStorageManager().getFileByPath(OCFile.ROOT_PATH));
+ folder = getFile();
+ }
+
+ onBrowsedDownTo(folder);
+
+ if (!stateWasRecovered) {
+ OCFileListFragment listOfFolders = getListOfFilesFragment();
+ listOfFolders.listDirectory(folder);
+
+ startSyncFolderOperation(folder, false);
+ }
+
+ updateNavigationElementsInActionBar();
+ }
+ }