How to do dr开发者_运维百科ag/drop functionality 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 as this functionality comes in Android 2.3
Thanks Saurabh!
hi here i give the link and go this post and find the solution of your question. where i post my whole activity code for everyone. so i think it`s help you best of luck
How to implement Drag and Drop in android 2.2?
and also find the another solution of how to do this.then use this link
http://code.google.com/p/rxwen-blog-stuff/source/browse/#svn/trunk/android/drag
And Another is
http://code.google.com/p/android-drag-and-drop-basic/source/browse/src/edu/sbcc/cs123/draganddropbasic/DragAndDropBasicActivity.java
My guess is you would need to listen for the touch of the user on the screen, identify the object that is being selected using the x/y coordinates, and then when the user releases the click, identify where they released. If it has changed, then work out where the new location is, and pass the object originally clicked to the other view, and remove it from the old one, placing it in the position clicked on the new view.
Look up OnClickListener for more information on how this works, in the Android Developer guides
精彩评论