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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:18:55+00:00 2026-06-14T07:18:55+00:00

I have programmed the following method in an attempt to get multi touch to

  • 0

I have programmed the following method in an attempt to get multi touch to work on the android, the problem is that when two fingers are on the screen they both receive the same getX() value, I need to get the location of each finger.

How can I get the location of both fingers? Thanks

public void onTouchEvent(MotionEvent event) 
{
  int pointerCount = event.getPointerCount();
  stats = "";
  for (int i = 0; i < pointerCount; i++) 
  {
      stats += "    " + i + " " + event.getAction() + "   " + event.getX();
      float x = event.getX(i);
      System.out.println(stats);
  }
}

here is an example of the print out: 0 2 200 1 2 200

  • 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-14T07:18:56+00:00Added an answer on June 14, 2026 at 7:18 am

    You are currently calling getX() without any parameters in the string you are logging out, which will always get the location of the first pointer. If you want to get the position for a particular pointer (finger), you need to call getX(int) and pass the pointer id that you want to read, like you did below setting the float value.

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

Sidebar

Related Questions

I have following problem; I have inerface with public method clone(): public interface Something
I'm a beginner programmer and I'm stuck with the following problem: If I have
I have the following form: <form name=survey1 action=add5up.php method=post onsubmit=return validateForm()> <div id=question>Q1) My
i have the following problem. The 1st step is to implement a program, which
I have the following Objective C test code in a SenTestCase class. I get
I'm following this tutorial for adding EULA to my Android application, but i have
Say I have the following method: void UpdateContentMethodA(Int32[] src, Int32[] dst) { for(int i=0;
I am a vb.net programmer switching to C#. I have the following code for
Suppose I have the following senario: Trunk is my main development line where programmers
I have programmed a shopping list. The footer contains buttons for actions on a

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.