Esempio n. 1
0
 /** Cancel loading of a drawable for a certain ImageView. */
 public void cancelLoad(ImageView view) {
   String fso = mRequests.get(view);
   if (fso != null && mWorkerHandler != null) {
     mWorkerHandler.removeMessages(MSG_LOAD, fso);
   }
   mRequests.remove(view);
 }
Esempio n. 2
0
        private void processResult(LoadResult result) {
          // Cache the new drawable
          final String filePath = (result.fso);
          mAppIcons.put(filePath, result.result);

          // find the request for it
          for (Map.Entry<ImageView, String> entry : mRequests.entrySet()) {
            final ImageView imageView = entry.getKey();
            final String fso = entry.getValue();
            if (fso == result.fso) {
              imageView.setImageBitmap(result.result);
              mRequests.remove(imageView);
              break;
            }
          }
        }