Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06ffc12a authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I237c1cee into eclair-mr2

* changes:
  Improve exception message thrown when a View's state is of the wrong type.
parents 24eca800 237c1cee
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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.");
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -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) {