views:

3575

answers:

5

How can I create a list where I can rearrange list items with dragging list rows to another row and so on (to change to order)?

Just like on the HTC Hero in the clocks app where you can rearrange the order of clocks?

Wouter

+1  A: 

Hint: download the android sources and have a look how the Music app (packages\apps\Music) implements this functionality.

alex
Thank you for your answer. I have downloaded the source code and used it before but where can I find the Activity that uses this functionality?
wouter88
@wouter88Sorry, I haven't looked for that myself. Just search the sources for `*List*` to find what Activities reference ListViews.
alex
+7  A: 

Pay special attention to this one com.android.music.TouchInterceptor

link: http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/TouchInterceptor.java;h=6c22e7234dcae7ceda5fd159637273c60449f32f;hb=HEAD

Bo
Thank you! I think it is what I am looking for ;)
wouter88
+1  A: 

It's in platform/packages/apps/Music/src/com/android/music/TouchInterceptor.java. Here's a direct link:

http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/TouchInterceptor.java;h=6c22e7234dcae7ceda5fd159637273c60449f32f;hb=HEAD

CaseyB
Thank you! Will take a look at it ;)
wouter88
A: 

if you have found drag and drop for genereic once can you help me .. music aap has drop listener implemented in a complex way

adrain
A: 

Even though this question is already answered. I struggled using the music app as an example, so I created a simple Drag and Drop List project to help others that can be found here

ericharlow