Fixed crash when download notification is pressed in landscape mode
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / fragment / FileDetailFragment.java
index 91980e5..c84e2cf 100644 (file)
@@ -245,8 +245,8 @@ public class FileDetailFragment extends SherlockFragment implements
             case R.id.fdDownloadBtn: {\r
                 //if (FileDownloader.isDownloading(mAccount, mFile.getRemotePath())) {\r
                 FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();\r
-                if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile.getRemotePath())) {\r
-                    downloaderBinder.cancel(mAccount, mFile.getRemotePath());\r
+                if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile)) {\r
+                    downloaderBinder.cancel(mAccount, mFile);\r
                     if (mFile.isDown()) {\r
                         setButtonsForDown();\r
                     } else {\r
@@ -256,9 +256,10 @@ public class FileDetailFragment extends SherlockFragment implements
                 } 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, mFile);\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
+                    i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());*/\r
                 \r
                     // update ui \r
                     setButtonsForTransferring();\r
@@ -443,7 +444,7 @@ public class FileDetailFragment extends SherlockFragment implements
             // configure UI for depending upon local state of the file\r
             //if (FileDownloader.isDownloading(mAccount, mFile.getRemotePath()) || FileUploader.isUploading(mAccount, mFile.getRemotePath())) {\r
             FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();\r
-            if ((downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile.getRemotePath())) || FileUploader.isUploading(mAccount, mFile.getRemotePath())) {\r
+            if ((downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile)) || FileUploader.isUploading(mAccount, mFile.getRemotePath())) {\r
                 setButtonsForTransferring();\r
                 \r
             } else if (mFile.isDown()) {\r