diff options
| author | Gilles Debunne <debunne@google.com> | 2011-01-27 11:07:16 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-27 11:07:16 -0800 |
| commit | 315f3865983f59e5ad9f42602f443e8c42b6e5c4 (patch) | |
| tree | 8d9130b687b83abf826f31c9152ba7429bc6b88f /core/java | |
| parent | bbdd9d3fbc1995adb4d327515ba0af8515436d2d (diff) | |
| parent | ddd6f3928756c439e8a7a975a9dc51248f687b7e (diff) | |
| download | frameworks_base-315f3865983f59e5ad9f42602f443e8c42b6e5c4.zip frameworks_base-315f3865983f59e5ad9f42602f443e8c42b6e5c4.tar.gz frameworks_base-315f3865983f59e5ad9f42602f443e8c42b6e5c4.tar.bz2 | |
Merge "CustomSelectionActionModeCallback can prevent selection mode from starting." into honeycomb
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 213117d..b024dcb 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8204,6 +8204,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * {@link android.R.id#selectAll}, {@link android.R.id#cut}, {@link android.R.id#copy} or * {@link android.R.id#paste} ids as parameters. * + * Returning false from {@link ActionMode.Callback#onCreateActionMode(ActionMode, Menu)} will + * prevent the action mode from being started. + * * Action click events should be handled by the custom implementation of * {@link ActionMode.Callback#onActionItemClicked(ActionMode, MenuItem)}. * @@ -8364,7 +8367,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener styledAttributes.recycle(); if (mCustomSelectionActionModeCallback != null) { - mCustomSelectionActionModeCallback.onCreateActionMode(mode, menu); + if (!mCustomSelectionActionModeCallback.onCreateActionMode(mode, menu)) { + // The custom mode can choose to cancel the action mode + return false; + } } if (menu.hasVisibleItems() || mode.getCustomView() != null) { |
