예제 #1
0
 @Override
 protected Void doInBackground(Context... params) {
   String profileImageURL = tweet.getProfileImageURL();
   Drawable pic = profilePics.get(profileImageURL);
   if (pic == null) {
     try {
       InputStream is = (InputStream) new URL(profileImageURL).getContent();
       pic = Drawable.createFromStream(is, "src");
       profilePics.put(profileImageURL, pic);
     } catch (MalformedURLException e) {
       Log.e(TAG, "Unable to get drawable at " + profileImageURL + " - malformed url", e);
     } catch (IOException e) {
       Log.e(TAG, "Unable to get drawable at " + profileImageURL + " - read failed", e);
     }
   }
   return null;
 }