am 1325f557: Stop crashing on invalid wallpaper thumbnail images.

Merge commit '1325f557bb2646cbaf00ed7d1de42b47cf59b895' into eclair-mr2

* commit '1325f557bb2646cbaf00ed7d1de42b47cf59b895':
  Stop crashing on invalid wallpaper thumbnail images.
This commit is contained in:
Daniel Sandler
2009-11-11 17:08:54 -08:00
committed by Android Git Automerger
@@ -171,9 +171,17 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
} else {
image = (ImageView) convertView;
}
image.setImageResource(mThumbs.get(position));
image.getDrawable().setDither(true);
int thumbRes = mThumbs.get(position);
image.setImageResource(thumbRes);
Drawable thumbDrawable = image.getDrawable();
if (thumbDrawable != null) {
thumbDrawable.setDither(true);
} else {
Log.e(Launcher.LOG_TAG, String.format(
"Error decoding thumbnail resId=%d for wallpaper #%d",
thumbRes, position));
}
return image;
}
}