diff options
Diffstat (limited to 'core/java/android/view/MenuInflater.java')
-rw-r--r-- | core/java/android/view/MenuInflater.java | 4 |
1 files changed, 4 insertions, 0 deletions
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)); } |