Android

Android Drag and Drop

Android Drag and Drop

As the name suggests, the drag-and-drop framework in Android provides the functionality to move data from one view to another view. The drag-and-drop process consists of four steps as described below:

  • Started: The drag-and-drop process starts when a user drags an item in a layout. The application calls the startDrag() method which tells the system to start a drag. First, the system responds by calling the application to get a drag shadow. 
  • Continuing: In this process, the user continues to drag where the system sends the ACTION_DRAG_ENTERED action which is followed by another action ACTION_DRAG_LOCATION. This way the action is sent to the registered drag event listener. 
  • Dropped: This process consists of realising the dragged item within the specified area of the View. 
  • Ended: This is the last process that is performed just after the drop event is finished. This way the action type ACTION_DROP sends a drag event with another action type ACTION_DRAG_ENDED that shows that the operation is completed. 
     

Top course recommendations for you

    Graphs in Python
    1 hrs
    Beginner
    2.4K+ Learners
    4.53  (68)
    Trees in Python
    2 hrs
    Beginner
    2.2K+ Learners
    4.62  (45)
    Python Tkinter
    1 hrs
    Beginner
    4.3K+ Learners
    4.54  (281)
    Database Normalization
    1 hrs
    Beginner
    4.2K+ Learners
    4.59  (225)
    Pattern Program in Java
    2 hrs
    Beginner
    3K+ Learners
    4.51  (49)
    DML Statements
    1 hrs
    Beginner
    3.8K+ Learners
    4.54  (249)
    GCD of Two Numbers
    2 hrs
    Beginner
    982 Learners
    4.63  (30)
    Language Translator in Python
    2 hrs
    Intermediate
    2.4K+ Learners
    4.66  (67)
    Matrix Multiplication in C
    1 hrs
    Beginner
    3.4K+ Learners
    4.48  (134)
    Waterfall Model
    1 hrs
    Beginner
    4.8K+ Learners
    4.45  (343)