Revert commit 6cdd830a7be28b77688efc3cd62857c1e71a1342
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / preview / PreviewImageFragment.java
index 41edc24..9d0edde 100644 (file)
@@ -46,6 +46,7 @@ import com.actionbarsherlock.view.MenuItem;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
 import com.owncloud.android.ui.fragment.FileFragment;
 import com.owncloud.android.utils.Log_OC;
@@ -165,7 +166,8 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener {
                 
                 // Update the file
                 if (mAccount!= null) {
-                    OCFile updatedFile = mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath());
+                    OCFile updatedFile = ((FileActivity) getSherlockActivity()).
+                            getStorageManager().getFileByPath(file.getRemotePath());
                     if (updatedFile != null) {
                         setFile(updatedFile);
                     } else {
@@ -174,7 +176,6 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener {
                 } else {
                     setFile(file);
                 }
-
             } else {
                 mIgnoreFirstSavedState = false;
             }