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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:34:42+00:00 2026-06-15T06:34:42+00:00

At first, i really know there are more than one post about it, but

  • 0

At first, i really know there are more than one post about it, but non helped me fixing the bug/misstake. I am sorry if its a repost and hope you guys can help me getting rid of this bug.

11-28 17:36:36.110: W/dalvikvm(8380): threadid=1: thread exiting with uncaught exception (group=0x40a331f8)
11-28 17:36:36.110: E/AndroidRuntime(8380): FATAL EXCEPTION: main
11-28 17:36:36.110: E/AndroidRuntime(8380): java.lang.IllegalArgumentException: pointerIndex out of range
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.MotionEvent.nativeGetAxisValue(Native Method)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.MotionEvent.getX(MotionEvent.java:1974)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.main.TouchEventControler.processJoyPadTouchRelease(TouchEventControler.java:194)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.main.TouchEventControler.processRelease(TouchEventControler.java:237)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.main.TouchEventControler.processTouchEvent(TouchEventControler.java:88)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.main.GameField.onTouchEvent(GameField.java:142)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.View.dispatchTouchEvent(View.java:5546)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1938)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1375)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1886)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.View.dispatchPointerEvent(View.java:5726)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.os.Looper.loop(Looper.java:137)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at android.app.ActivityThread.main(ActivityThread.java:4424)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at java.lang.reflect.Method.invokeNative(Native Method)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at java.lang.reflect.Method.invoke(Method.java:511)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-28 17:36:36.110: E/AndroidRuntime(8380):     at dalvik.system.NativeStart.main(Native Method)

I do handle them like this and i am happy that it sometimes runs like i want it if it dont crash by that error:

public void processTouchEvent(MotionEvent event) {

    // create an action
    int action = (event.getActionMasked() & MotionEvent.ACTION_MASK);
    // getting pointerindex
    int pointerIndex = ((event.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT);
    // getting pointer id

    //catch invalide
    if(pointerIndex == MotionEvent.INVALID_POINTER_ID){
        return;
    }

    int pointerId = event.findPointerIndex(pointerIndex);
    // switch case for the action
    switch (action) {
    case MotionEvent.ACTION_DOWN: // if action down
        processHitButtonTouch(event, pointerId);
        processJoyPadTouch(event, pointerId);
        break;
    case MotionEvent.ACTION_POINTER_DOWN: // if pointer down (second
                                            // finger/third)
        processHitButtonTouch(event, pointerId);
        processJoyPadTouch(event, pointerId);
        break;
    case MotionEvent.ACTION_UP: // if action up
        processRelease(event, pointerId);
    case MotionEvent.ACTION_POINTER_UP: // if action up second/third finger
        processRelease(event, pointerId);
    default:
        break;
    }
}

In the methodes i call in that switch i just get the position of the touch and handle them. I just could put a getX(pointerIndex) in a try catch and return if its a error. But isnt there a better way?!

Thanks alot for all that help i already got.

Asked for:

    public void processJoyPadTouchRelease(MotionEvent event, int pointerId) {
    int touchPosX = (int) event.getX(pointerId);
    int touchPosY = (int) event.getY(pointerId);

    if (( //dont freak out here! it's just looking for if the
            //touch was inside the Joypad! Nothing more!!
            //it's in breckets!
            touchPosX > 2 * Config.BLOCKSIZE
            && touchPosX < 4 * Config.BLOCKSIZE
            && touchPosY > 3 * Config.BLOCKSIZE
            && touchPosY < 5 * Config.BLOCKSIZE
            // touch up event handled
            || 2 * Config.BLOCKSIZE < touchPosX
            && touchPosX < (Config.BLOCKSIZE * 4)
            && touchPosY > (7 * Config.BLOCKSIZE)
            && touchPosY < (9 * Config.BLOCKSIZE)
            // touch down handled
            || (touchPosX < 2 * Config.BLOCKSIZE
            && touchPosY > (5 * Config.BLOCKSIZE) 
            && touchPosY < (7 * Config.BLOCKSIZE))
            // touch left handled
            || (4 * Config.BLOCKSIZE < touchPosX
            && touchPosX < (Config.BLOCKSIZE * 6)
            && touchPosY > (5 * Config.BLOCKSIZE) 
            && touchPosY < 7 * Config.BLOCKSIZE)) 
            //touch right handled

            //and the char isnt idle (so it's moving)
        && charac.getStatus() != Status.IDLE)
    //THAN do =>>
    {
        charac.setStatus(Status.IDLE);
        joyPad.status = Status.IDLE;
    }
}
  • 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-15T06:34:44+00:00Added an answer on June 15, 2026 at 6:34 am

    Try to make sure that pointerIndex < event.getPointerCount();

    But i think that maybe you have a misunderstanding here. The pointerIndex in your code is the index of the pointer that changed, it should only be used in ACTION_POINTER_DOWN and ACTION_POINTER_UP. If you only have one finger on the screen, the pointerIndex is invalid here.

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

Sidebar

Related Questions

I know there is more than one question out there that matches this, but
first of all, I'm really thankful for all your help. I need just one
This is really a three-part question, but I've answered the first question myself: I'm
In a recent question of mine I learned that if there are more than
First let me start of saying I know absolutely nothing about c++ and I
EDIT : This reproducible SIGSEGV happens on a Linux machine with more than one
I am having difficulties with pages that have more than one <audio> when I
at first i'm really new to ORM, nhibernate and FHN. i look into this
first of all I'm really not really friendly with ruby or with rails, so
First of all, I'm really new to the MVC Asp.Net ideology. I would like

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.