- Intent i = new Intent(getActivity(), FileDownloader.class);\r
- i.putExtra(FileDownloader.EXTRA_ACCOUNT, mAccount);\r
- i.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mFile.getRemotePath());\r
- i.putExtra(FileDownloader.EXTRA_FILE_PATH, mFile.getRemotePath());\r
- i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());\r
+ if (FileDownloader.isDownloading(mAccount, mFile.getRemotePath())) {\r
+ \r
+ // TODO cancelar descarga\r
+ \r
+ if (mFile.isDown()) {\r
+ setButtonsForDown();\r
+ } else {\r
+ setButtonsForRemote();\r
+ }\r
+ \r
+ } else {\r
+ Intent i = new Intent(getActivity(), FileDownloader.class);\r
+ i.putExtra(FileDownloader.EXTRA_ACCOUNT, mAccount);\r
+ i.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mFile.getRemotePath());\r
+ i.putExtra(FileDownloader.EXTRA_FILE_PATH, mFile.getRemotePath());\r
+ i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());\r