开发者

Drag and drop in preferences (reordering of items)

开发者 https://www.devze.com 2023-04-09 04:05 出处:网络
I have few items like this <ListPreference android:key=\"key1\" android:title=\"@string/title\" android:entries=\"@array/asd\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号