How to drag multiple bitmaps on Android Surfaceview

I am using a SurfaceView and have drawn multiple bitmaps to the view. My question is how can I use the Touch Listener to target each bitmaps move action independently?

Basically I want the user to be able to arrange the bitmaps in any order they like. I came up with a method of determining the space utilized on the SurfaceView for each bitmap and then checking the x and y values of the touch listener to determine if the user was selecting a known location of the bitmap. The problem I am having is that if bitmaps end up crossing each other then they stick together as they share the same space.

I am thinking there is probably a simpler way to handle the events of multiple bitmaps, any suggestions?


First you need to select the bit map follow the link for further detail. Detect touch on bitmap

Need Your Help

Windows batch file : How to redirect console logs of a background process to 'NUL'

java windows batch-file background-process

I have created a batch file which calls a java process in background. All I want is to redirect the logs of the java process to a 'NUL' output so that the background terminal does not contain any o...

Set UIView to correct device width with Auto Layout when using Universal Storyboard: trailing and leading spaces give wrong value

ios swift uiview storyboard autolayout

When using Auto Layout and Universal Storyboard, we discovered that using Trailing Space and Leading Space to make a UIView's width equal to the device width does not work.