diff options
author | Joe Onorato <joeo@android.com> | 2010-03-11 14:55:23 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-11 14:55:23 -0800 |
commit | 05212067451f5f4e94e2a548eaf5be8d4283a8ee (patch) | |
tree | bd829eff737dff9c47a56e47cd812b6c085b6c64 | |
parent | ef5a8e5bdc996fef88269e6695fbcf6ce0fb73cc (diff) | |
parent | 42e14d74f3a1e146091e627ae3067651c6dab104 (diff) | |
download | frameworks_base-05212067451f5f4e94e2a548eaf5be8d4283a8ee.zip frameworks_base-05212067451f5f4e94e2a548eaf5be8d4283a8ee.tar.gz frameworks_base-05212067451f5f4e94e2a548eaf5be8d4283a8ee.tar.bz2 |
Merge "Throw a better error message when the automatic onClick handling doesn't work."
-rw-r--r-- | core/java/android/view/View.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 7a0c445..e8bb736 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2078,8 +2078,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mHandler = getContext().getClass().getMethod(handlerName, View.class); } catch (NoSuchMethodException e) { + int id = getId(); + String idText = id == NO_ID ? "" : " with id '" + + getContext().getResources().getResourceEntryName( + id) + "'"; throw new IllegalStateException("Could not find a method " + - handlerName + "(View) in the activity", e); + handlerName + "(View) in the activity " + + getContext().getClass() + " for onClick handler" + + " on view " + View.this.getClass() + idText, e); } } |