android: fade in animation
<p>I try to fade in a buttons in a specific order. Each time one button fades, but the buttons fade in all together after the code is finished. I tried to use Thread.sleep after each fade order but it doesn't help at all. Does someone have an idea?</p>

<p>the code:</p>

<pre><code> for(int i=0;i&lt;counter;i++)

    {

        switch (entered[i]) {
        case 1:
            ImageView myImageView1= (ImageView)findViewById(R.id.red_button);
            Animation myFadeInAnimation1 = AnimationUtils.loadAnimation(this, R.anim.fadein);
            myImageView1.startAnimation(myFadeInAnimation1); //Set animation to your ImageView
            break;

        case 2:
            ImageView myImageView2= (ImageView)findViewById(R.id.yellow_button);
            Animation myFadeInAnimation2 = AnimationUtils.loadAnimation(this, R.anim.fadein);
            myImageView2.startAnimation(myFadeInAnimation2); //Set animation to your ImageView
            break;  
        case 3:
            ImageView myImageView3= (ImageView)findViewById(R.id.green_button);
            Animation myFadeInAnimation3 = AnimationUtils.loadAnimation(this, R.anim.fadein);
            myImageView3.startAnimation(myFadeInAnimation3); //Set animation to your ImageView
            break;  
        case 4:
            ImageView myImageView4= (ImageView)findViewById(R.id.blue_button);
            Animation myFadeInAnimation4 = AnimationUtils.loadAnimation(this, R.anim.fadein);
            myImageView4.startAnimation(myFadeInAnimation4); //Set animation to your ImageView
            break;
        default:
            //finish();
            break;
        }

        try {
            Thread.sleep(3000);    // one second
        }

        catch (Exception e) {} 

    }
</code></pre>
