I’m new to android programming (writing my first app now) and I need some help.
I’ve set up my Framelayout with a linearlayout inside of it with a button, ImageView, and TextView.
I want to be able to draw a bitmap I have ONTO the ImageView where and when the user touches onto the ImageView. I have my ontouchlistener set up (and i know it’s working, i’ve tested) but I can’t figure out how to make the bitmap (a 20px by 20px ball) show up where the user touches it. Is there a way I can do this, or add a canvas on top of the ImageView?
Sorry if my question wasn’t very detailed or too noobish but im really having some trouble with this and I need an explanation from someone. Thanks in advance!
I thought there was an example of this in the android sdk, I’m often forgetful about these things but I definitely found exactly what you are looking for on the web. But my search-fu is all out of funk today.
Here’s something to get you started, you might need to modify so that you do the draw on touch.
http://android-er.blogspot.com/2010/05/draw-bitmap-on-view.html
Also use the search on this site … just type [android] +draw +bitmap +touch into the search box to specify that you want to filter on the android tag and force include the search terms.
Also take a look at android drawing on touch event