Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8486677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:00:57+00:00 2026-06-10T21:00:57+00:00

I am implementing Drag and Drop from ListView to another ListView,i got sample app

  • 0

I am implementing Drag and Drop from ListView to another ListView,i got sample app here,

How to Drag drop Listview item to another Listview

using above app created one app,It’s working fine up to 4th image of ListView.In my view By default ListView display up to 3rd position(means 0,1,2,3),if i drag the 2nd position from first ListView and drop in second ListView,It’s display same image.When i scroll down,positions is 4,5,6,7.if i drag 6th position,it’s takes 2nd position. please help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:00:59+00:00Added an answer on June 10, 2026 at 9:00 pm

    You should use a for loop .Then give the count of number to the list and check with each count.Check if the id’s of the loops are the same if they are different you will directly get different images at the stored place.

    public boolean onTouchEvent(MotionEvent ev) {
            // TODO Auto-generated method stub
            final int action = ev.getAction();
            final int x = (int) ev.getX();
            final int y = (int) ev.getY();  
    
            if (action == MotionEvent.ACTION_DOWN && x < this.getWidth()/4) {
                mDragMode = true;
            }
    
            if (!mDragMode) 
                return super.onTouchEvent(ev);
    
            switch (action) {
                case MotionEvent.ACTION_DOWN:
                    mStartPosition = pointToPosition(x,y);
                    if (mStartPosition != INVALID_POSITION) {
                        int mItemPosition = mStartPosition - getFirstVisiblePosition();
                        mDragPointOffset = y - getChildAt(mItemPosition).getTop();
                        mDragPointOffset -= ((int)ev.getRawY()) - y;
                        startDrag(mItemPosition,y);
                        drag(0,y);// replace 0 with x if desired
                    }   
                    break;
                case MotionEvent.ACTION_MOVE:
                    drag(0,y);// replace 0 with x if desired
                    break;
                case MotionEvent.ACTION_CANCEL:
                case MotionEvent.ACTION_UP:
                default:
                    mDragMode = false;
                    mEndPosition = pointToPosition(x,y);
                    stopDrag(mStartPosition - getFirstVisiblePosition());
                    if (mDropListener != null && mStartPosition != INVALID_POSITION && mEndPosition != INVALID_POSITION) 
                         mDropListener.onDrop(mStartPosition, mEndPosition);
                    break;
            }
            return true;
        }
    

    this will help u to push the code in from one location to another.And on the Drag method specify the x&y where you want to push it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please refer to my prior question here about implementing drag/drop. I got everything working
I'm implementing drag & drop from a ListBox, but I'm seeing some strange behaviour
Hey I am implementing the drag and drop operations using Kineticjs Now I want
I'm implementing a drag & drop script in (plain) JavaScript. All good, except one
I'm implementing a solution to drag an element from a container to another. Until
I'm implementing drag & drop on a ListView. I already managed to get the
I'm implementing simple drag-and-drop functionality in my app, and I would like to know
I am using a pan gesture to drag an item in my app. I
I am using jQuery UI Sortable widget for implementing drag and drop functionality in
I'm implementing a drag and drop system in an iphone app. So far I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.