use of com.android.volley.Request.Priority in project iosched by google.
the class RequestQueueTest method makeRequests.
/**
* Make a list of requests with random priorities.
* @param count Number of requests to make
*/
private List<MockRequest> makeRequests(int count) {
Request.Priority[] allPriorities = Request.Priority.values();
Random random = new Random();
List<MockRequest> requests = new ArrayList<MockRequest>();
for (int i = 0; i < count; i++) {
MockRequest request = new MockRequest();
Request.Priority priority = allPriorities[random.nextInt(allPriorities.length)];
request.setCacheKey(String.valueOf(i));
request.setPriority(priority);
requests.add(request);
}
return requests;
}
Aggregations