Search code examples
androidandroid-gesture

Best practice for onFling() in android?


What is the difference with this two methods?

@Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
                float velocityY) {
            return super.onFling(e1, e2, velocityX, velocityY);
        }

@Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
                float velocityY) {
            return true;
        }

the second onFling return true and first return its method, what is the difference of this two and which of this two is the best practice in returning onFling?


Solution

  • It is based on your requirement. If you don't want the android frame work to handle onFling , return true.