0
I have a for
where it sweeps a vector String
, sending command completed increment .
for(int i=0; i < msg.size(); i++)
{
enviarComando(msg.get(i));
}
When he sends I want him to wait 1 second for each shipment.
I tried to use and this code inside for
, but I did not succeed, it does not wait 1 seconds expected.
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 1000);
Here I think you have the example of what you are looking for. Future and Futures Task
– murakami Kauê