Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling image for button

 
Ryan Lemon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an image in src/images/ and I try to call it a couple different ways, but to no avail. In this first code, CreateListGroup can't be resolved:



I've also tried bitmap, but I keep getting an error saying CreateLGImage can't be resolved:


 
Ron McLeod
Bartender
Pie
Posts: 1048
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If what you want to do is use an image as a button, you can use an ImageButton widget. The image file should be placed in res/drawable.

For example:

 
Ryan Lemon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ron! That worked great.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic