Skip to content Skip to sidebar Skip to footer

Drag And Drop With Cwac-touchlist

I have two questions. 1. How to make app remember new order in ListView what I made with drag and drop. Like now I can reorder items but every time I open app, I have to reorder it

Solution 1:

How to make app remember new order in ListView what I made with drag and drop. Like now I can reorder items but every time I open app, I have to reorder items again.

Store the order somewhere (e.g., sequence column in your database table) and re-order the data when loading it back into your Adapter.

My app should open different webpage from each item. But when I reorder items then web links doesn't reorder. They stick on same.

Quoting the documentation:

In code, you set up a TouchListView just like a regular ListView, except that you need to register a TouchListView.DropListener via setDropListener(). In your listener, you will need to do something to affect the re-ordering requested via the drag-and-drop operation. In the demo project, this is a matter of removing the entry from the old position and putting it in the new position.

Post a Comment for "Drag And Drop With Cwac-touchlist"