diff options
author | Romain Guy <romainguy@android.com> | 2009-12-09 15:49:29 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-12-09 15:49:29 -0800 |
commit | 8f4bca2acada86c36c7de59e8891ef120098aa19 (patch) | |
tree | 7f24168a0995b75a628c7cf18a54ba48e5cb5782 /core/java | |
parent | 68a3b8b66044d0a9fa901ad306fc6db6d13f94d3 (diff) | |
parent | 06ffc12a398bf16fb360d74b7511d946a73a741e (diff) | |
download | frameworks_base-8f4bca2acada86c36c7de59e8891ef120098aa19.zip frameworks_base-8f4bca2acada86c36c7de59e8891ef120098aa19.tar.gz frameworks_base-8f4bca2acada86c36c7de59e8891ef120098aa19.tar.bz2 |
am 06ffc12a: Merge change I237c1cee into eclair-mr2
Merge commit '06ffc12a398bf16fb360d74b7511d946a73a741e' into eclair-mr2-plus-aosp
* commit '06ffc12a398bf16fb360d74b7511d946a73a741e':
Improve exception message thrown when a View's state is of the wrong type.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/View.java | 6 | ||||
-rw-r--r-- | core/java/android/view/ViewDebug.java | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 1fc3678..d94d0c2 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5961,7 +5961,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility protected void onRestoreInstanceState(Parcelable state) { mPrivateFlags |= SAVE_STATE_CALLED; if (state != BaseSavedState.EMPTY_STATE && state != null) { - throw new IllegalArgumentException("Wrong state class -- expecting View State"); + throw new IllegalArgumentException("Wrong state class, expecting View State but " + + "received " + state.getClass().toString() + " instead. This usually happens " + + "when two views of different type have the same id in the same hierarchy. " + + "This view's id is " + ViewDebug.resolveId(mContext, getId()) + ". Make sure " + + "other views do not use the same id."); } } diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java index 4baf612..2fd974e 100644 --- a/core/java/android/view/ViewDebug.java +++ b/core/java/android/view/ViewDebug.java @@ -1300,7 +1300,7 @@ public class ViewDebug { } } - private static Object resolveId(Context context, int id) { + static Object resolveId(Context context, int id) { Object fieldValue; final Resources resources = context.getResources(); if (id >= 0) { |