1

I need to display an image from server on a button. Could anyone help me please.

vivek
  • 4,599
  • 3
  • 25
  • 37

2 Answers2

0

Load the image from web and use it as background of Button. Or you can use ImageButton and use the loaded image as image resource. Here is an example to load image from web How to load an ImageView by URL in Android?

Community
  • 1
  • 1
Walid Hossain
  • 2,724
  • 2
  • 28
  • 39
0

This example could help you:

http://en.androidwiki.com/wiki/Loading_images_from_a_remote_server

You just need to delete the random file names and change the button ids.

NCode
  • 2,758
  • 1
  • 16
  • 25
  • I can set that image to a imageView but not as a background for button – vivek Nov 04 '11 at 07:30
  • For displaying Images on a button, you need an ImageButton, which is a subclass of the ImageView used in the tutorial. http://developer.android.com/reference/android/widget/ImageButton.html – NCode Nov 04 '11 at 07:32