user1008467
user1008467

Reputation:

OnTouchEvent getPointerCount() detects always 1 pointer after releasing the screen touch

I was just trying to make this function work but I am having troubles. When I start the application, getPointerCount returns 0 pointers, when I touch the screen with one finger, 1. (It does recognize 2,3 4... fingers if I touch the screen with several fingers). After releasing the screen, however, it returns always 1, and if I touch with more than one finger again then it returns the right number of pointers.

Here is my simple code:

    public boolean onTouchEvent(MotionEvent event) {
        int count=event.getPointerCount();

        tv.setText(String.valueOf(count));

        return true;
    }

Why is not returning 0 after releasing the screen?

Thank you all

Upvotes: 1

Views: 2954

Answers (1)

Taras Leskiv
Taras Leskiv

Reputation: 1875

Please read the documentation before asking this.

getPointerCount() always returns int which is equal or greater than 1

Upvotes: 1

Related Questions