24794

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

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

Answer1:

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.

Answer2:

Android does not support this method in version < 3.0 but if you want to implement this then you need to change the layout param .

Hope this will work you

Answer3:

Use this jar file to use functions of all versions up to version 4.

http://www.java2s.com/Code/Jar/a/Downloadandroidsupportv4jar.htm

Recommend

  • gulp rollup not working external resource import
  • webstorm autocomplete for require(.json)
  • How to write numpy arrays to .txt file, starting at a certain line? numpy version 1.6
  • R colors - many distinctive colors that are still pretty
  • JQuery UI selectable plugin - Multiple mouse drag selection and unselect option
  • Change color of row programmatically in WatchKit
  • Can't CTRL+Drag NSButton to custom NSView header
  • jquery draggable stop event
  • Client side validation mvc dropdown
  • Pre-populated SQLite Database not reading properly in Android Studio
  • Deploying a CodeRush plugin from the Community Site
  • How to override value that appears in a dropdown in the rails_admin gem
  • where do I find the xml.dom python package for the python-2.6.0-8.9.28 and I have a suse/x86_64 vers
  • SAVE attribute needed for Fortran variables when only the C_LOC address is returned to a C program?
  • Spring boot 2.0.0.M4 required a bean named 'entityManagerFactory' that could not be found
  • Read text file that is not in the main package in a runnable jar
  • Roxygen error “Skipping invalid path”
  • Hardware Accelerated Image Scaling in windows using C++
  • How to attach a node.js readable stream to a Sendgrid email?
  • Disable Enter in editText android
  • Cannot resolve symbol 'MyApi'
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse
  • Can I make an Android app that runs a web view in Chrome 39?
  • Javascript + PHP Encryption with pidCrypt
  • Hazelcast - OperationTimeoutException
  • Release, debug version and Authorization Google?
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • R: gsub and capture
  • RestKit - RKRequestDelegate does not exist
  • How to include full .NET prerequisite for Wix Burn installer
  • Revoking OAuth Access Token Results in 404 Not Found
  • Benchmarking RAM performance - UWP and C#
  • Qt: Run a script BEFORE make
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • How can i traverse a binary tree from right to left in java?
  • Conditional In-Line CSS for IE and Others?
  • Net Present Value in Excel for Grouped Recurring CF