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 7856843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:50:08+00:00 2026-06-02T20:50:08+00:00

OK, first of all I’m not sure I’m doing this right so I will

  • 0

OK, first of all I’m not sure I’m doing this right so I will explain what I want from my application:

I have a screen that split for two- from left a list of groups (for more specific- ExpandableListView), and in the left I have all kind of draggable buttons.
I want to let the user to drag each button to some group and then I’ll add the button text as child of this group.

So what I’ve tried to do is to add touchListener using (setOnTouchListener) to each button and realize to where the user drag it, so I now have the X and Y where the user release the btn, how can I know what list item is on the (x,y) point?

and if it is the right way doing it?

Thx.

Edit:
OK, for being more clear I’m adding a snapshot of screen:

screen snapshot

what I want is to drag the button to some item in the list and doing something with the item that was selected (lets say- rename it)

  • 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-02T20:50:10+00:00Added an answer on June 2, 2026 at 8:50 pm

    OK, I got it- if somebody ever go here, this is how I solved it-
    iterate over all list children and check whether this p=(x,y) is in the hit rect:

    int count = draggTo.getChildCount();
    for (int i = i; i < count; i--) {
        View child = draggTo.getChildAt(i);
        child.getHitRect(frame);
        if (frame.contains(x, y)) {
            return draggTo.getFirstVisiblePosition() + i;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code below, with which I select first all id's from table
First of all, apologize because I have seen some posts about this, but I
I have 3 cards. at first all cards move to the right, then after
I have movies table with movieID,movieName and movieDate. I want to select first all
First of all, I know how to build a Java application. But I have
First of all: I am not an experienced ClearCase user, but I have lots
i have this code which i use in order to extract first all users
first of all, I'm not a programmer, so the answer to this might be
First of all, this relates to a desktop application rather than an ASP .Net
First of all this is how the script works: jsfiddle So, I want to

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.