imageView = (ImageView) findViewById(R.id.sItemIcon); imageView.setBackgroundDrawable(loadDrawable(R.drawable.id)); //软引用设置 private Map<Integer, SoftReference<Drawable>> imageCache = new HashMap<Integer, SoftReference<Drawable>>(); private Drawable loadDrawable(Integer id){ if(imageCache.containsKey(id)){ Drawable d=imageCache.get(id).get(); if(d!=null)return d; } Drawable d=getResources().getDrawable(id); imageCache.put(id, new SoftReference<Drawable>(d)); return d; }