Code example for View

Methods: setOnLongClickListener

0
     * android.view.View.OnLongClickListener}. 
     * 
     * @param view The view whose cheat sheet should be removed. 
     */ 
    public static void remove(final View view) {
        view.setOnLongClickListener(null);
    } 
 
    /** 
     * Internal helper method to show the cheat sheet toast. 
     */ 
    private static boolean showCheatSheet(Activity activity, View view, CharSequence text) {
        if (TextUtils.isEmpty(text)) {
            return false; 
        } 
 
        final int[] screenPos = new int[2]; // origin is device display
        final Rect displayFrame = new Rect(); // includes decorations (e.g. status bar)
        view.getLocationOnScreen(screenPos);
        view.getWindowVisibleDisplayFrame(displayFrame);