You do not need to distill data from the database into some local arrays. Work directly with the database, it has an order of magnitude more powerful than the "pitiful" methods of collections, the SQL language, specially designed for processing, sorting, and so on. The data contained in the database, as well as performs this processing by orders of magnitude faster than Java.
The very approach you are trying to apply looks somewhat illogical. Why store the data in the database, but process it in some primitive and slow ways, while still wasting time on intermediate retrieval from the database into the array, then into another array.
On the question - you do not need to save some sort of changed sorting order, rewriting the database. You need the correct query in the database, which will return the data (cursor), sorted in the correct order, this is how it is done. Then this cursor, in which everything is already sorted as it should be through the SQL query, you send directly to the list adapter and fill the list itself with data from the cursor, and not from some ArrayList.
UPD If you want to save an arbitrary custom sort, then again you need to modify not the following of the records in the database, but add one more column to each record to store the sort order. When dragging, write to this column a position in the list of the item to which it was dragged. When selecting, make a query with sorting by this column.
That is, an exemplary scheme - we make a selection from the database with time sorting, fill this list with a selection, while dragging we write to the database the position into which we dragged (to the user sorting column for the record that was dragged), update the adapter through the selection with sorting by column with these positions everything is simple and transparent
This will be the correct architecture of working with the database, and what you are trying to do, some kind of amateur crutch, sorry for the sharpness, I hope this will help you understand the depth of the errors :)
See also this sorting response in the database.