O'Reilly logo

Pro Android 4 by Satya Komatineni, Dave MacLean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring Drag and Drop

In this next example application, we’re going to take a white dot and drag it to a new location in our user interface. We’re also going to place three counters in our user interface, and if the user drags the white dot to one of the counters, that counter will increment and the dot will return back to its starting place. If the dot is dragged somewhere else on the screen, we’ll just leave it there.

NOTE: See the “References” section at the end of this chapter for the URL from which you can import these projects into Eclipse directly. We’ll only show code in the text to explain concepts. You’ll need to download the code to create a working example application.

The first sample application for this chapter is called TouchDragDemo. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required