Fixed wrong field override breaking options menu in PreviewMediaFragment and PreviewI...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / preview / PreviewImageFragment.java
index 41edc24..b78ae5f 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;
@@ -77,8 +78,6 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener {
 
     private boolean mIgnoreFirstSavedState;
 
-    private FileFragment.ContainerActivity mContainerActivity;
-
     
     /**
      * Creates a fragment to preview an image.
@@ -165,7 +164,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 +174,6 @@ ConfirmationDialogFragment.ConfirmationDialogFragmentListener {
                 } else {
                     setFile(file);
                 }
-
             } else {
                 mIgnoreFirstSavedState = false;
             }