It is used to reorder the list items by
just draggin and dropping them to the desired posotion.
// Initialize your list view in layout file as follows: <com.tcs.view.DragDropListView android:layout_width="fill_parent" android:clickable="false" android:id="@android:id/list" android:layout_height="fill_parent" android:drawingCacheQuality="high" android:layout_above="@+id/linearLayout2above"> </com.tcs.view.DragDropListView>
//Import the attached java file in your package. // Set the listener on your LIst View Object with the following code Where "view" is the list view object in below line. ((DragDropListView) view).setDropListener(mDropListener); // Initialize the listener as folows. // Here variable from tells you item's initial position and to tells you the final position. wrtie your own waht you want to do with List you have passed as an adpater. /** * Drop Listener it will listen to from and to position of drop event when * the user will drop the selected item at the desired event. */ private DragDropListView.DropListener mDropListener = new DragDropListView.DropListener() { public void drop(int from, int to) { } };
You need to cutomize the layout item in
attached file as per your requirement.