views:

78

answers:

3

i need to insert 2 images and 2 buttons.action required is that whn i click on th first button corrsponding image should be displayed.same action required for other button also but second image should be displayed.

+3  A: 

I'm guessing you mean a button with an image on it?

For that, you'll need an ImageButton.

Dave
i need to insert 2 images and 2 buttons.action required is that whn i click on th first button corrsponding image should be displayed.same action required for other button also but second image shid be displayed.
antony joe
So you want the image to be displayed after button click or the image should be a button?
Ravi Vyas
there should always 2 buttons and an image.image switches according to the button
antony joe
ah.. well looks like we all got it wrong initially
Ravi Vyas
A: 

Image button can be added as

<ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton01" android:layout_height="wrap_content" android:src="@drawable/icon">
</ImageButton>
Amith GC
A: 

Assuming we finally understood what is required you need to have an onClick listener on both the buttons which when invoked will change the image you are displaying :-)

Ravi Vyas