I have a list of items that are displayed using a ListView from a SQLCursor. The SQL table includes(as well as other things) a _id field and an order field. I use the order field to sort the list before it gets to the ListView.
What I need is a widget like the MediaPlayer has in its playlist view. It allows you to click the icon and drag the item in the playlist around and put it into a new order. With that ability I can then retrieve the new order and update the SQL table with the new order. However, I am not having any luck finding any clues to help me add that functionality into my program.
The question is whether I can use existing functions to help me, or do I need to manually program motion events and such until I get nearly the same functionality.
If you want the functionality from the Music application (which, by the way, is not named “MediaPlayer”), go look at its source code. Here is a StackOverflow question with answers that point you to the specific class (
TouchInterceptor) that enables the drag-and-drop.If you are looking for a widget with built-in drag-and-drop, there is none in the SDK.