Working with intentservice to get the data of 7 Rss Feed links with using \" Google Volley \" in the background and use ResultReceiver to get the result , But I can\'t confi
This question was answered in the official Volley Google Group.
Wrap the request in a RequestFuture to make a blocking call using RequestFuture#newFuture(...);
You can find sample code in the Volley source code:
RequestFuture 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
}
Be sure to use a timeout in future.get(...)
or else your thread will lock.