Button click action in android?
<p>I have two buttons in android. Btn1 and Btn2. I need to show Btn1 by default and when is is clicked I need to show Btn2 in place of Btn1. Again when
Btn2 is clicked, it should be replaced with Btn2. Please help me with some example..</p>

<p>My Code:</p>

<pre><code>btn1 = (ImageView) findViewById(R.id.firstbtn);

        btn2 = (ImageView) findViewById(R.id.secondbutton);
        btn2.setVisibility(ImageView.GONE);

        btn1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                btn2.setVisibility(ImageView.VISIBLE);
            }
        });

        btn2.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                btn2.setVisibility(ImageView.GONE);




            }

        });
</code></pre>

<p>Thanks in advance</p>
