Code example for Handler

Methods: getLooper

0
        GestureHandler() { 
            super(); 
        } 
 
        GestureHandler(Handler handler) {
            super(handler.getLooper());
        } 
 
        @Override 
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case SHOW_PRESS:
                mListener.onShowPress(mCurrentDownEvent);
                break; 
                 
            case LONG_PRESS:
                dispatchLongPress(); 
                break; 
                 
            case TAP:
                // If the user's finger is still down, do not count it as a tap