Sleep in For loop
<p>I am developing a simple game. I want to have small wait in each interation of a <code>for</code> loop that will be executed on button click.</p>

<p>I have tried using <code>Thread.sleep(2000)</code>, but to no avail.</p>

<p>Here is the code of button click:</p>



<pre><code>public void playClick(View v) {
        String item;
        try{
            final Handler handler = new Handler();
        for (int i = 0; i &lt; stringList.size(); i++) {

             Thread.sleep(2000);
            item = stringList.get(i);

            if(item.equals("left")){

                leftclick();

            }else if(item.equals("right")){

                rightClick();

            }else if(item.equals("up")){

                upClick();

            }else if(item.equals("down")){

                downClick();

            }
        }
        }catch(Exception e){
            Toast.makeText(this, ""+e.toString(), Toast.LENGTH_SHORT).show();
        }
</code></pre>

<p>I want to wait in each execution of the <code>for</code> loop.</p>
