类 RequestFuture<T>

java.lang.Object
com.android.volley.toolbox.RequestFuture<T>
类型参数:
T - The type of parsed response this future expects.
所有已实现的接口:
Response.ErrorListener, Response.Listener<T>, Future<T>

public class RequestFuture<T> extends Object implements Future<T>, Response.Listener<T>, Response.ErrorListener
A Future that represents a Volley request. Used by providing as your response and error listeners. For example:
 RequestFuture<JSONObject> future = RequestFuture.newFuture();
 MyRequest request = new MyRequest(URL, future, future);

 // If you want to be able to cancel the request:
 future.setRequest(requestQueue.add(request));

 // Otherwise:
 requestQueue.add(request);

 try {
   JSONObject response = future.get();
   // do something with response
 } catch (InterruptedException e) {
   // handle the error
 } catch (ExecutionException e) {
   // handle the error
 }