Drag and drop image in Android 2.2

How to make a drag-and-drop function to move a view from one position to another position in the current layout using a graphical drag-and-drop gesture in API level 8 since this functionality is included in Android 2.3

Thanks Saurabh!

+2


source to share


2 answers


Hi here I am giving the link and submitting this post and finding a solution to your question. where i post all my activity code for everyone. so i think it will help you good luck.

How do I implement drag and drop in Android 2.2?

and also find another solution how to do it. Then use this link



http://code.google.com/p/rxwen-blog-stuff/source/browse/#svn/trunk/android/drag

And further

http://code.google.com/p/android-drag-and-drop-basic/source/browse/src/edu/sbcc/cs123/draganddropbasic/DragAndDropBasicActivity.java

+2


source


I am guessing that you will need to listen for the user's touch on the screen, identify the object that is being selected using x / y coordinates, and then when the user releases the click, determine where they were released. If it has changed, then figure out where the new location is and pass the object that was originally clicked to the other view and remove it from the old one by placing it in position by clicking on the new view.



Have a look at OnClickListener for more information on how this works in Android Developer Guides

+2


source







All Articles