In Java (Android), is there a way to create a loop that goes through a lot of operations, but only is capable of doing n amount of operations at a time?
For example, let’s say I need to make 50 network operations, but only want to run, say, ten at a time, and queue the rest?
Cheers
EDIT: This is already fixed. I found a solution for my problem, but cannot close the question yet. Sorry!
This seems like more of a design issue than anything else. My current project requires a similar solution, and we decided to use a bounded ExecutorService to solve the problem. It may not be suitable for your particular issue, but it’s worth checking out. I am also not up to speed on Android development unfortunately, so I’m not sure whether it would be a suitable solution, but check this thread.