Drag and drop in preferences (reordering of items)
I have few items like this
<ListPreference android:key="key1"
android:title="@string/title"
android:entries="@array/asd"
android:entryValues="@array/asd1"
android:defaultValue="109" android:dialogTitle="title"
android:negativeButtonText="@string/cancel" />
<ListPreference android:key="key2"
android:title="@string/title2"
android:entries="@array/asd2"
android:开发者_如何学CentryValues="@array/asd22"
android:defaultValue="109" android:dialogTitle="title"
android:negativeButtonText="@string/cancel" />
and they are all placed in one category . . ., the thing I want to do is to be able to reorder the items ( to put key2 before key1 with drag and drop)
is this possible at all in android and how can I do this ?, what methods should I override ?
After dragging the second item and doping above the first the items should be swapped.
Go through this example
It helps me a lot.
精彩评论