I am using SPenEventLibrary to recognise if touch is done by finger or Spen. It was working all the time until I updated to Android L.
Device: Galaxy Note 3.
Spen lib is up to date: libspen23.jar, pen-v3.1.8.jar
Android version: 5.0.
Code is simple:
mSPenEventLibrary.setSPenTouchListener(this, new SPenTouchListener(){
@Override
public boolean onTouchFinger(View view, MotionEvent event) {
if (ApplicationPreferences.get(mContext).getSPENWristGaurdOnOff() == false) {
return handleEvent(event);
} else {
return true;
}
}
@Override
public boolean onTouchPen(View view, MotionEvent event) {
return handleEvent(event);
}
@Override
public void onTouchButtonDown(View arg0, MotionEvent arg1) {
}
@Override
public void onTouchButtonUp(View arg0, MotionEvent arg1) {
}
@Override
public boolean onTouchPenEraser(View arg0, MotionEvent arg1) {
}
});
When I touch screen with Spen onTouchFinger() is called instead of onTouchPen(). On older Android versions onTouchPen() was called.
This is answer from samsung developers forum:
public boolean onTouch(View view, MotionEvent event) {
}