- mFile = mStorageManager.getFileById(mFile.getFileId()); // update the file from database, for the local storage path
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- transaction.replace(R.id.fragment, new PreviewMediaFragment(mFile, mAccount, 0, true), FileDetailFragment.FTAG);
- transaction.commit();
+ setFile(mStorageManager.getFileById(getFile().getFileId())); // update the file from database, for the local storage path
+ if (PreviewMediaFragment.canBePreviewed(getFile())) {
+ FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+ transaction.replace(R.id.fragment, new PreviewMediaFragment(getFile(), getAccount(), 0, true), FileDetailFragment.FTAG);
+ transaction.commit();
+ } else {
+ detailsFragment.updateFileDetails(false, (success));
+ }