I have a for
where it scans a String
vector, sending command increment 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 this code inside for
, but I did not succeed, it does not wait for 1 second expected.
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 1000);