cb.setChecked(mFile.keepInSync());\r
\r
// configure UI for depending upon local state of the file\r
- if (mFile.isDownloading()) {\r
+ if (FileDownloader.isDownloading(mAccount, mFile.getRemotePath())) {\r
setButtonsForDownloading();\r
\r
} else if (mFile.isDown()) {\r
public void onReceive(Context context, Intent intent) {\r
String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);\r
\r
- if (accountName.equals(mAccount.name) && mFile != null) {\r
+ if (!isEmpty() && accountName.equals(mAccount.name)) {\r
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);\r
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);\r
if (mFile.getRemotePath().equals(downloadedRemotePath)) {\r