Code example for GestureDetector

Methods: onTouchEvent

0
    /** 
     * Call this before calling {@code super.dispatchTouchEvent(MotionEvent)}. 
     */ 
    public void preDispatchTouchEvent(MotionEvent event) {
        if (mGestureDetector != null) {
            mGestureDetector.onTouchEvent(event);
        } 
    } 
 
    /** 
     * Get the background color of the theme used for this activity. 
     * 
     * @return The background color of the current theme. 
     */ 
    public int getThemeBackgroundColor() { 
        TypedArray array = mActivity.getTheme().obtainStyledAttributes(
                new int[] { android.R.attr.colorBackground });
 
        int backgroundColor = array.getColor(0, 0xFF00FF);
 
        array.recycle();