@Override public void run() { File f = null; if (fileUrl != null) { f = new File(fileUrl); } if (fileUrl != null && f.exists()) { cBitmap = new CachedBitmap(BitmapDecoder.decodeBitmap(PREFERRED_LENGTH, fileUrl), PREFERRED_LENGTH); if (cBitmap.getBitmap() != null) { storeBitmapInCache(cBitmap); } else { Log.w(TAG, "Could not load bitmap. Using default image."); cBitmap = new CachedBitmap( BitmapFactory.decodeResource(target.getResources(), R.drawable.default_cover), PREFERRED_LENGTH); } if (AppConfig.DEBUG) Log.d(TAG, "Finished loading bitmaps"); } else { if (fileUrl == null) { Log.w(TAG, "File URL is null"); } else { Log.w(TAG, "File does not exist anymore."); } onInvalidFileUrl(); } endBackgroundTask(); }