I need to insert two images and two buttons. The action required is that when I click on the first button, the corresponding image 开发者_开发问答should be displayed. The same action is required for other button also, but the second image should be displayed.
I'm guessing you mean a button with an image on it?
For that, you'll need an ImageButton.
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>
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 :-)
精彩评论