diff options
author | Adam Powell <adamp@google.com> | 2010-07-27 16:34:07 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2010-07-27 21:04:52 -0700 |
commit | 5d27977f9da482627ceb19317a2cd70467aff046 (patch) | |
tree | a96b2c2a9aeba5f2e3b92a256949677880063d35 /core/java/android | |
parent | 85d8daa889db113b51c5d98929245e80f7277388 (diff) | |
download | frameworks_base-5d27977f9da482627ceb19317a2cd70467aff046.zip frameworks_base-5d27977f9da482627ceb19317a2cd70467aff046.tar.gz frameworks_base-5d27977f9da482627ceb19317a2cd70467aff046.tar.bz2 |
Action modes without action bar
Change-Id: I0367ab35e598a17980bd373b30828175f6283acc
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/Activity.java | 4 | ||||
-rw-r--r-- | core/java/android/view/MenuInflater.java | 4 | ||||
-rw-r--r-- | core/java/android/view/Window.java | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 142c325..9beaec0 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4080,13 +4080,13 @@ public class Activity extends ContextThemeWrapper * * @see ActionMode */ - public ActionMode startContextMode(ActionMode.Callback callback) { + public ActionMode startActionMode(ActionMode.Callback callback) { return mWindow.getDecorView().startActionMode(callback); } public ActionMode onStartActionMode(ActionMode.Callback callback) { if (mActionBar != null) { - return mActionBar.startContextMode(callback); + return mActionBar.startActionMode(callback); } return null; } diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java index 4a966b5..a959e0d 100644 --- a/core/java/android/view/MenuInflater.java +++ b/core/java/android/view/MenuInflater.java @@ -350,6 +350,10 @@ public class MenuInflater { .setShowAsAction(itemShowAsAction); if (itemListenerMethodName != null) { + if (mContext.isRestricted()) { + throw new IllegalStateException("The android:onClick attribute cannot " + + "be used within a restricted context"); + } item.setOnMenuItemClickListener( new InflatedOnMenuItemClickListener(mContext, itemListenerMethodName)); } diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index b077b56..0d4e84b 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -62,7 +62,12 @@ public abstract class Window { * replaces the title bar and provides an alternate location * for an on-screen menu button on some devices. */ - public static final int FEATURE_ACTION_BAR = 9; + public static final int FEATURE_ACTION_BAR = 8; + /** + * Flag for specifying the behavior of action modes when an Action Bar is not present. + * If overlay is enabled, the action mode UI will be allowed to cover existing window content. + */ + public static final int FEATURE_ACTION_MODE_OVERLAY = 9; /** Flag for setting the progress bar's visibility to VISIBLE */ public static final int PROGRESS_VISIBILITY_ON = -1; /** Flag for setting the progress bar's visibility to GONE */ |