Chapter 22. Drag-and-drop


This chapter covers

  • The drag-and-drop classes
  • Drag-and-drop operations
  • The shadow builder
  • Listening for drag-and-drop events


Starting with Android 3.0 (API 11), developers can add drag-and-drop capabilities to applications. Drag-and-drop support is one of the neat features added in Android 3.0, a natural addition to touch-based user interfaces and tablets. Android 3.0 provides a complete framework for drag-and-drop that consists of multiple classes, events, and operations. Related to drag-and-drop are copy-and-paste operations. Although copy and paste has been around since API 1, a much richer clipboard API has been introduced in API 11.

Drag-and-drop is a touch-based gesture. With drag-and-drop gestures, you ...

Get Android in Action, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.