• 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
Saloon Keeper
Posts: 1295
149
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!