Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the solution I got to in the end If it is any help to anyone: </p> <pre><code> private static Method GetPointCountMethod; private boolean mIsTouchMove = false; private static boolean mTapable = true; static { // Check if the getPointerCount method is availabe (aka api level 5) try { GetPointCountMethod = MotionEvent.class.getMethod("getPointerCount"); /* success, this is a newer device */ } catch (NoSuchMethodException nsme) { /* failure, must be older device */ } }; // Invoke the getPointCount Method if it exists private int getPointCount(MotionEvent event) { try { return (Integer) GetPointCountMethod.invoke(event); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return -1; } @Override public boolean dispatchTouchEvent(MotionEvent event) { // Set the tappable to be only when the map is realy just tapped and not moved or zoomed if (event.getAction() == MotionEvent.ACTION_UP) { if (GetPointCountMethod != null) { if (getPointCount(event) == 1) { if (mIsTouchMove) { mIsTouchMove = false; } else { mTapable = true; // Finaly - a Tap! : } } } } else if (event.getAction() == MotionEvent.ACTION_MOVE) { mTapable = (false); mIsTouchMove = true; } // let the rest do their job return super.dispatchTouchEvent(event); } </code></pre> <p>There is still no support for 1.6 and that is why this is still open ill wait to see if there is a way to do it also in 1.6</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload