How to design movable (Drag/Drop) view in android.
In my case

There will be four rows and all will be movable.
User can arrange all 4 rows like 1234, 2341, 3421, 1243…… any combination of 1234.
So how can it will be?
All rows are layouts.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a members declared for holding the currently dragging bitmap, view, and current dragging x and y coords.
onTouchof the parent view.ACTION_DOWNevent get the drawing cache(Bitmap) of the dragging view by callinggetDrawingCache()and set to the drag bitmap member. Invalidate the layout (so that onDraw gets called, where you draw the currently dragging view). Hide the current dragging view.ACTION_MOVEdraw (invalidate) the dragging view bitmap at current x and y coordinates.ACTION_UPdestroy the dragging bitmap. calculate the current drop location and add the current dragging view to that position in the layout. UnHide the current dragging view. Reset the dragging members.In
onDrawof parent layout.