How to change ImageButton image onclick. My code is not working
<p>I can't figure out why my code isn't working.  I've got an ImageButton declared and I'm when the user clicks on the image, I was to increment <code>valHomeFouls</code>.  When <code>valHomeFouls &gt; 5</code> then it is reset to 0.</p>

<p>For some reason it is not changing the image onClick.</p>

<pre><code>    // set the onClick listener for the foulsHome ImageButton
    btnFoulsHome.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            valFoulsHome++;

            if( valFoulsHome &gt; 5 )
                valFoulsHome = 0;

            switch( valFoulsHome ) {
                case 5:
                    btnFoulsHome.setImageResource(R.drawable.fouls5);
                case 4:
                    btnFoulsHome.setImageResource(R.drawable.fouls4);
                case 3:
                    btnFoulsHome.setImageResource(R.drawable.fouls3);
                case 2:
                    btnFoulsHome.setImageResource(R.drawable.fouls2);
                case 1:
                    btnFoulsHome.setImageResource(R.drawable.fouls1);
                case 0:
                    btnFoulsHome.setImageResource(R.drawable.fouls0);
            }
        }
    });
</code></pre>

<p>Can anyone see why?</p>
