Merge remote-tracking branch 'origin/master' into moresync
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / ui / activity / FileDisplayActivity.java
index d5bdc59..3412af8 100644 (file)
@@ -633,11 +633,14 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
             if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) {  \r
             \r
                 String synchFolderRemotePath = intent.getStringExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH); \r
-                        \r
-                if (mCurrentDir == null)\r
+                 \r
+                boolean fillBlankRoot = false;\r
+                if (mCurrentDir == null) {\r
                     mCurrentDir = mStorageManager.getFileByPath("/");\r
+                    fillBlankRoot = (mCurrentDir != null);\r
+                }\r
 \r
-                if (synchFolderRemotePath != null && mCurrentDir != null && mCurrentDir.getRemotePath().equals(synchFolderRemotePath) ) {\r
+                if (synchFolderRemotePath != null && mCurrentDir != null && (mCurrentDir.getRemotePath().equals(synchFolderRemotePath) || fillBlankRoot) ) {\r
                     FileListFragment fileListFragment = (FileListFragment) getSupportFragmentManager()\r
                             .findFragmentById(R.id.fileList);\r
                     mCurrentDir = getStorageManager().getFileByPath(synchFolderRemotePath);\r