How to make imagebuttons visible invisible by decending order?
<p>I am having 5 Image Buttons that I want to make visible and invisible  by descending order.like 5,4,3,2,1 and that was done. but when I come to ImageButton1 I am not able to make it invisible again.because two conditions are running at the same time on that button. one is making 2,3,4,5 button Invisible and another is making that Imagebutton1  Invisible.so what can I do?</p>

<pre><code>     imgmilku1.setOnClickListener(new OnClickListener() {

      public void onClick(View v) {
            // TODO Auto-generated method stub
            imgmilks1.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.INVISIBLE);
            imgmilks3.setVisibility(View.INVISIBLE);
            imgmilks4.setVisibility(View.INVISIBLE);
            imgmilks5.setVisibility(View.INVISIBLE);
            imgmilks3.setVisibility(View.INVISIBLE);
            imgmilku1.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.VISIBLE);
            imgmilku3.setVisibility(View.VISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilku5.setVisibility(View.VISIBLE);

            firstglass = 1 * 300;

        }
    });
    imgmilks1.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            // imgmilks1.setVisibility(View.VISIBLE);
            // imgmilku1.setVisibility(View.INVISIBLE);
            imgmilks4.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilks5.setVisibility(View.INVISIBLE);
            imgmilku5.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.VISIBLE);


            firstglass = 1 * 300;
        }
    });

imgmilku2.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

            imgmilks1.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilku1.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.VISIBLE);

            secondglass = 2 * 300;

        }
    });
    imgmilks2.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            imgmilks4.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilks5.setVisibility(View.INVISIBLE);
            imgmilku5.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.VISIBLE);
            secondglass = 2 * 300;


        }
    });
</code></pre>

<p>imgmilku3.setOnClickListener(new OnClickListener() {</p>

<pre><code>        public void onClick(View v) {
            // TODO Auto-generated method stub
            imgmilks1.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.VISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilku1.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.INVISIBLE);

            thirdglass = 3 * 300;

        }
    });
    imgmilks3.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

            imgmilks4.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.VISIBLE);
            imgmilks5.setVisibility(View.INVISIBLE);
            imgmilku5.setVisibility(View.VISIBLE);
            fourtglass = 0;
            thirdglass = 3 * 300;



        }
    });
</code></pre>

<p>imgmilku4.setOnClickListener(new OnClickListener() {</p>

<pre><code>        public void onClick(View v) {
            // TODO Auto-generated method stub
            imgmilks1.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.VISIBLE);
            imgmilks4.setVisibility(View.VISIBLE);
            imgmilku1.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.INVISIBLE);
            fourtglass = 4 * 300;



        }
    });
    imgmilks4.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

            imgmilks5.setVisibility(View.INVISIBLE);
            imgmilku5.setVisibility(View.VISIBLE);
            fifthglass = 0;
            fourtglass = 4 * 300;

        }
    });

    imgmilku5.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            imgmilks5.setVisibility(View.VISIBLE);
            imgmilks4.setVisibility(View.VISIBLE);
            imgmilks3.setVisibility(View.VISIBLE);
            imgmilks2.setVisibility(View.VISIBLE);
            imgmilks1.setVisibility(View.VISIBLE);

            imgmilku5.setVisibility(View.INVISIBLE);
            imgmilku4.setVisibility(View.INVISIBLE);
            imgmilku3.setVisibility(View.INVISIBLE);
            imgmilku2.setVisibility(View.INVISIBLE);
            imgmilku1.setVisibility(View.INVISIBLE);
            firstglass = 0;
            secondglass = 0;
            thirdglass = 0;
            fourtglass = 0;

            fifthglass = 5 * 300;


        }
    });
</code></pre>
