My app sends data to a server every few minutes. It works fine as long as I'm online. When I'm offline in between, it seems like the stringRequests
are temporarily stored in the requestQueue
and fired all together as soon as I establish the internet connection.
To avoid adding duplicates to the requestQueue
, I'm looking for something like the following pseudo-code:
if (!requestQueue.isRequestInQueue(stringRequest)) {
requestQueue.add(stringRequest);
}
I'd like to avoid using requestQueue.cancelAll()
.
Any ideas how to avoid duplicates in a RequestQueue
? Thanks in advance!