Code example for View.OnLongClickListener

Methods: onLongClick

0
 
    private final Runnable repeatAction = new Runnable() {
        @Override 
        public void run() { 
            if (repeatClickListener != null) { 
                boolean res = repeatClickListener 
                    .onLongClick(RepeatImageButton.this); 
                if (res == true) 
                    mHandler.postDelayed(this, interval); 
                longClickFired = true; 
            } 
        } 
    }; 
 
    public RepeatImageButton(Context ctx, AttributeSet attrs) {
        super(ctx, attrs);
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        switch (ev.getActionMasked()) {