-
- } else if (mMessageViewRef != null && result == null) {
- // error
- int messageId;
- if (mThrowable == null) {
- messageId = R.string.preview_image_error_unknown_format;
- Log.e(TAG, "File could not be loaded as a bitmap: " + mFile.getStoragePath());
-
- } else if (mThrowable instanceof OutOfMemoryError) {
- messageId = R.string.preview_image_error_unknown_format;
- Log.e(TAG, "Out of memory occured for file " + mFile.getStoragePath(), mThrowable);
-
- } else if (mThrowable instanceof NoSuchFieldError) {
- messageId = R.string.common_error_unknown;
- Log.e(TAG, "Error from access to unexisting field despite protection; file " + mFile.getStoragePath(), mThrowable);
-
- } else {
- messageId = R.string.common_error_unknown;
- Log.e(TAG, "Unexpected error loading " + mFile.getStoragePath(), mThrowable);
- }
+ }
+ if (mMessageViewRef != null) {
+ final TextView messageView = mMessageViewRef.get();
+ if (messageView != null) {
+ messageView.setVisibility(View.GONE);
+ } // else , silently finish, the fragment was destroyed
+ }
+ }
+
+ private void showErrorMessage() {
+ if (mImageViewRef != null) {
+ final ImageView imageView = mImageViewRef.get();
+ if (imageView != null) {
+ // shows the default error icon
+ imageView.setVisibility(View.VISIBLE);
+ } // else , silently finish, the fragment was destroyed
+ }
+ if (mMessageViewRef != null) {