com.bumptech.glide.request
Interface FutureTarget<R>

Type Parameters:
R - The type of resource this FutureTarget will retrieve.
All Superinterfaces:
Future<R>, LifecycleListener, Target<R>
All Known Implementing Classes:
RequestFutureTarget

public interface FutureTarget<R>
extends Future<R>, Target<R>

An interface for an object that is both a Target and a Future. For example:

 FutureTarget<Bitmap> futureTarget = Glide.with(fragment)
                                       .load("http://goo.gl/1asf12")
                                       .asBitmap()
                                       .into(250, 250);
 Bitmap myBitmap = futureTarget.get();
 ... // do things with bitmap and then release when finished:
 Glide.clear(futureTarget);
 
 

Note - Future.get() and Future.get(long, java.util.concurrent.TimeUnit) must be called off of the main thread or they will block forever.


Field Summary
 
Fields inherited from interface com.bumptech.glide.request.target.Target
SIZE_ORIGINAL
 
Method Summary
 void clear()
          Safely clears the target from a background thread to release its resources.
 
Methods inherited from interface java.util.concurrent.Future
cancel, get, get, isCancelled, isDone
 
Methods inherited from interface com.bumptech.glide.request.target.Target
getRequest, getSize, onLoadCleared, onLoadFailed, onLoadStarted, onResourceReady, setRequest
 
Methods inherited from interface com.bumptech.glide.manager.LifecycleListener
onDestroy, onStart, onStop
 

Method Detail

clear

void clear()
Safely clears the target from a background thread to release its resources.