I have a threadpool executor with several threads which are running concurrently. I want to execute some code after all threads have completed. How can I achieve this?
for(String x : mList){
mExecutor.execute(new Runnable(){
@Override
public void run() {
//Do Stuff
}
});
//after all threads finish
doOtherStuff();
This should achieve what you need: