Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use view.setX() method in android version less then 3.0

Tags:

android

i want to implement drag and drop feature but the device version is 2.2.1 so application is not working i am use onTouch method and set coordinate using setx() and setY() but this method is not working on my device version please tell me the alternet way to implement this thanks in advance


1 Answers

Unfortunatelly Android Support Package doesn't contain new Drag-n-Drop from API 11 (Android 3.0) probably because it would need platform-side changes.

Basically you can find examples in Android 2.1 source code for Launcher. But it's a bit complicated. Checkout this implementation of custom ListView component with drag-n-drop. It helped me a lot when I had the same task.

like image 165
Andrey Ermakov Avatar answered Dec 07 '25 19:12

Andrey Ermakov