X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/91225458c1c52614b0254badd9b5e25ebe880f8e..3ce234e6c7858443738b71bd74dba4f754ce13a1:/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java diff --git a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java index ee695553..0397e5b5 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java @@ -203,9 +203,13 @@ public class FileDetailFragment extends SherlockFragment implements if (mFile.getMimetype().startsWith("image/")) { BitmapFactory.Options options = new Options(); options.inScaled = true; - options.inMutable = false; - options.inPreferQualityOverSpeed = false; options.inPurgeable = true; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + options.inPreferQualityOverSpeed = false; + } + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { + options.inMutable = false; + } Bitmap bmp = BitmapFactory.decodeFile(mFile.getStoragePath(), options); @@ -224,6 +228,14 @@ public class FileDetailFragment extends SherlockFragment implements } catch (OutOfMemoryError e) { preview.setVisibility(View.INVISIBLE); Log.e(TAG, "Out of memory occured for file with size " + mFile.getFileLength()); + + } catch (NoSuchFieldError e) { + preview.setVisibility(View.INVISIBLE); + Log.e(TAG, "Error from access to unexisting field despite protection " + mFile.getFileLength()); + + } catch (Throwable t) { + preview.setVisibility(View.INVISIBLE); + Log.e(TAG, "Unexpected error while creating image preview " + mFile.getFileLength()); } downloadButton.setText(R.string.filedetails_open); downloadButton.setOnClickListener(new OnClickListener() {