- boolean sameAccount = accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name);\r
- boolean isDescendant = (mCurrentDir != null) && (downloadedRemotePath != null) && (downloadedRemotePath.startsWith(mCurrentDir.getRemotePath()));\r
- if (sameAccount && isDescendant) {\r
- OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList);\r
- if (fileListFragment != null) { \r
- fileListFragment.listDirectory();\r
+ if (accountName != null && AccountUtils.getCurrentOwnCloudAccount(context) != null) {\r
+ boolean sameAccount = accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name);\r
+ boolean isDescendant = (mCurrentDir != null) && (downloadedRemotePath != null) && (downloadedRemotePath.startsWith(mCurrentDir.getRemotePath()));\r
+ if (sameAccount && isDescendant) {\r
+ OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList);\r
+ if (fileListFragment != null) { \r
+ fileListFragment.listDirectory();\r
+ if ( mWaitingToPreview != null && \r
+ mWaitingToPreview.getRemotePath().equals(downloadedRemotePath) && \r
+ intent.getAction().equals(FileDownloader.DOWNLOAD_ADDED_MESSAGE) ) {\r
+ \r
+ Fragment fragment = getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG);\r
+ if (fragment != null && fragment instanceof FileDetailFragment ) {\r
+ FileDetailFragment detailFragment = (FileDetailFragment) fragment;\r
+ if (detailFragment.getFile().getRemotePath().equals(downloadedRemotePath)) {\r
+ detailFragment.listenForTransferProgress();\r
+ detailFragment.updateFileDetails(true);\r
+ }\r
+ }\r
+ }\r
+ }\r