Code example for SoftReference

Methods: clear

0
		this.antiWeapon = anti;
		this.galleryImage = galleryImage;
	} 
 
	public void clearSoftReferences() { 
		galleryImageSoftReference.clear();
	} 
	 
	public Bitmap getGalleryPicture(Context context) {
		int H = (int)(ApplicationManager.SCREEN_H*0.8);
		if(H > ApplicationManager.GALLERY_MAX_BITMAP_SIZE_DP) H = ApplicationManager.GALLERY_MAX_BITMAP_SIZE_DP;//Dimensione massima per i quadri.
		Bitmap data = galleryImageSoftReference.get();
		if(data == null) {
			Options opts = new BitmapFactory.Options();
	    	opts.inSampleSize=1;
	    	Bitmap.Config conf = Bitmap.Config.RGB_565;
	    	opts.inPreferredConfig = conf;
	    	opts.inTempStorage = new byte[16*1024];
			Bitmap rawdata = BitmapFactory.decodeResource(context.getResources(), getGalleryImage(),opts);
			data = Bitmap.createScaledBitmap(rawdata, H, H, true);
Contextual code suggestions in your IDE  Get Codota for Java