Fixed crash when download notification is pressed in landscape mode
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / fragment / FileDetailFragment.java
index d0c2c74..c84e2cf 100644 (file)
@@ -84,7 +84,6 @@ import com.owncloud.android.network.OwnCloudClientUtils;
 import com.owncloud.android.ui.activity.FileDetailActivity;\r
 import com.owncloud.android.ui.activity.FileDisplayActivity;\r
 import com.owncloud.android.ui.activity.TransferServiceGetter;\r
-import com.owncloud.android.ui.fragment.OCFileListFragment.ContainerActivity;\r
 import com.owncloud.android.utils.OwnCloudVersion;\r
 \r
 import com.owncloud.android.R;\r
@@ -246,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
@@ -257,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
@@ -444,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