If you’re trying to create a drag-and-drop ListView using the TouchListView (aka cwac-touchlist) library (which essentially refactors the code used by Google in the playlist tab of the Music app), you may encounter an undocumented bug: If two or more items have the same content, say, the same String value, and you attempt to drag and drop them together, the list items will randomly reshuffle and not let that happen. I drove myself crazy trying to find the cause of this bug, but I couldn’t find anything (It’s not often that listViews have the same content repeated in multiple rows, I suppose).
Anyway, to work around the bug, I came up with this silly hack:
StringBuilder builder = new StringBuilder();
word is a String being added to the ListView. To avoid multiple rows having the same value, I’ve had to resort to padding the word with spaces!